diff options
author | crupest <crupest@outlook.com> | 2022-05-03 22:01:04 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-05-03 22:01:04 +0800 |
commit | fc6805afcc73900162df5ee7742c22450d9f8ec0 (patch) | |
tree | f5a3301a3097aeb040daabe33743871444eaa295 | |
parent | 28ee8811b60e782f1b8d556f5c73f64d49d1707b (diff) | |
download | timeline-fc6805afcc73900162df5ee7742c22450d9f8ec0.tar.gz timeline-fc6805afcc73900162df5ee7742c22450d9f8ec0.tar.bz2 timeline-fc6805afcc73900162df5ee7742c22450d9f8ec0.zip |
...
-rw-r--r-- | BackEnd/Timeline.Tests/packages.lock.json | 52 | ||||
-rw-r--r-- | FrontEnd/src/locales/en/translation.json | 1 | ||||
-rw-r--r-- | FrontEnd/src/locales/zh/translation.json | 1 | ||||
-rw-r--r-- | FrontEnd/src/views/settings/index.tsx | 18 |
4 files changed, 35 insertions, 37 deletions
diff --git a/BackEnd/Timeline.Tests/packages.lock.json b/BackEnd/Timeline.Tests/packages.lock.json index 32cba1af..d944771e 100644 --- a/BackEnd/Timeline.Tests/packages.lock.json +++ b/BackEnd/Timeline.Tests/packages.lock.json @@ -396,29 +396,6 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, - "Microsoft.IdentityModel.JsonWebTokens": { - "type": "Transitive", - "resolved": "6.17.0", - "contentHash": "I3cSVE185qF3a222/iQIdmBFhrhZBtz7wZ1RUUbMuHC1un79XCI7vggbWdmbqIttFcUoeziemadO6t+3FLjcSA==", - "dependencies": { - "Microsoft.IdentityModel.Tokens": "6.17.0" - } - }, - "Microsoft.IdentityModel.Logging": { - "type": "Transitive", - "resolved": "6.17.0", - "contentHash": "Ix6/CMLDoo939NDf1ARDuGK6YERY7pAX9WYbfwb4gZqx7r52unMFIykJk+zlEBX7jjtbDz/0uzikQFvheV9KsQ==" - }, - "Microsoft.IdentityModel.Tokens": { - "type": "Transitive", - "resolved": "6.17.0", - "contentHash": "mhOe+d9BQg5U45TkTCyXAFOjl7RvwaFj6v9qo8b+WFolkuGsfjSFfQ+WI9D3ho9sD/fK75gvL4JptmjLzyUPkw==", - "dependencies": { - "Microsoft.CSharp": "4.5.0", - "Microsoft.IdentityModel.Logging": "6.17.0", - "System.Security.Cryptography.Cng": "4.5.0" - } - }, "Microsoft.NETCore.Platforms": { "type": "Transitive", "resolved": "5.0.0", @@ -1031,15 +1008,6 @@ "System.Runtime.InteropServices": "4.3.0" } }, - "System.IdentityModel.Tokens.Jwt": { - "type": "Transitive", - "resolved": "6.17.0", - "contentHash": "G3rY4WLr54Mo+97+AEq0ANpiKvW7E8Qu5bKWfVMa7rkyJtvrOxUqp/OLqrGw/6JDbD5GlxnAtFKukGteUuB0rQ==", - "dependencies": { - "Microsoft.IdentityModel.JsonWebTokens": "6.17.0", - "Microsoft.IdentityModel.Tokens": "6.17.0" - } - }, "System.IO": { "type": "Transitive", "resolved": "4.3.0", @@ -1436,8 +1404,21 @@ }, "System.Security.Cryptography.Cng": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "WG3r7EyjUe9CMPFSs6bty5doUqT+q9pbI80hlNzo2SkPkZ4VTuZkGWjpp77JB8+uaL4DFPRdBsAY+DX3dBK92A==" + "resolved": "4.3.0", + "contentHash": "03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } }, "System.Security.Cryptography.Csp": { "type": "Transitive", @@ -1761,8 +1742,7 @@ "Microsoft.EntityFrameworkCore.Analyzers": "6.0.4", "Microsoft.EntityFrameworkCore.Sqlite": "6.0.4", "NSwag.AspNetCore": "13.15.10", - "SixLabors.ImageSharp": "2.1.1", - "System.IdentityModel.Tokens.Jwt": "6.17.0" + "SixLabors.ImageSharp": "2.1.1" } } } diff --git a/FrontEnd/src/locales/en/translation.json b/FrontEnd/src/locales/en/translation.json index c0bde4be..5ce4d70e 100644 --- a/FrontEnd/src/locales/en/translation.json +++ b/FrontEnd/src/locales/en/translation.json @@ -188,6 +188,7 @@ "myRegisterCodeDesc": "Click to create a new register code.", "renewRegisterCode": "Renew Register Code", "renewRegisterCodeDesc": "Confirm to renew register code? The old one will no longer be used.", + "myRegisterCodeCopied": "Register code copied!", "dialogChangePassword": { "title": "Change Password", "prompt": "You are changing your password. You need to input the correct old password. After change, you need to login again and all old login will be invalid.", diff --git a/FrontEnd/src/locales/zh/translation.json b/FrontEnd/src/locales/zh/translation.json index 1b538f2a..721ac81a 100644 --- a/FrontEnd/src/locales/zh/translation.json +++ b/FrontEnd/src/locales/zh/translation.json @@ -188,6 +188,7 @@ "myRegisterCodeDesc": "点击以创建新的注册码。", "renewRegisterCode": "创建新的注册码", "renewRegisterCodeDesc": "确定要创建新的注册码吗?旧的注册码将无法再使用。", + "myRegisterCodeCopied": "注册码已复制!", "dialogChangePassword": { "title": "修改密码", "prompt": "您正在修改密码,您需要输入正确的旧密码。成功修改后您需要重新登陆,而且以前所有的登录都会失效。", diff --git a/FrontEnd/src/views/settings/index.tsx b/FrontEnd/src/views/settings/index.tsx index 3cd5d889..31726dc2 100644 --- a/FrontEnd/src/views/settings/index.tsx +++ b/FrontEnd/src/views/settings/index.tsx @@ -16,6 +16,7 @@ import ChangeAvatarDialog from "./ChangeAvatarDialog"; import ChangeNicknameDialog from "./ChangeNicknameDialog"; import "./index.css"; +import { pushAlert } from "@/services/alert"; interface SettingSectionProps { title: I18nText; @@ -196,7 +197,22 @@ const SettingsPage: React.FC = (_) => { ) : registerCode === null ? ( <span>Noop</span> ) : ( - <code className="register-code">{registerCode}</code> + <code + className="register-code" + onClick={(event) => { + void navigator.clipboard + .writeText(registerCode) + .then(() => { + pushAlert({ + type: "success", + message: "settings.myRegisterCodeCopied", + }); + }); + event.stopPropagation(); + }} + > + {registerCode} + </code> )} </SettingItemContainer> <ButtonSettingItem |