From 8c7c012785bbe0bb495a5a9b81bd2272bff6c326 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Tue, 31 Oct 2023 14:28:32 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=B7=BB=E5=8A=A0=E8=AE=BF=E9=97=AEIP?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en.json | 1 + src/i18n/langs/ja.json | 1 + src/i18n/langs/zh.json | 1 + src/router/profile/index.js | 33 ++++++--- src/views/profile/ApiKey.vue | 10 ++- .../profile/ApiKeyCreateUpdate/index.vue | 71 +++++++++++++++++++ 6 files changed, 106 insertions(+), 11 deletions(-) create mode 100644 src/views/profile/ApiKeyCreateUpdate/index.vue diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index a95cf4919..bced525fc 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -2319,6 +2319,7 @@ }, "profile": { "CreateAccessKey": "Create Access key", + "AccessIP": "Access IP", "ApiKeyWarning": "To reduce the risk of AccessKey exposure, Secret is provided only during creation and cannot be queried again later. Please keep it safe.", "PasskeyAddDisableInfo": "Your authentication source is {source}, and Passkey addition is not supported." } diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index c05aacdac..441b2ad50 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -2309,6 +2309,7 @@ }, "profile": { "CreateAccessKey": "Create Access key", + "AccessIP": "Access IP", "ApiKeyWarning": "AccessKeyの漏洩リスクを低減するため、Secretは作成時にのみ提供され、後で再度クエリできません。安全に保管してください。", "PasskeyAddDisableInfo": "あなたの認証元は {source} であり、Passkeyの追加はサポートされていません。" } diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 2360711b0..e61d7e50c 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -1881,6 +1881,7 @@ }, "profile": { "CreateAccessKey": "创建访问密钥", + "AccessIP": "访问IP", "ApiKeyWarning": "为降低 AccessKey 泄露的风险,只在创建时提供 Secret,后续不可再进行查询,请妥善保存。", "PasskeyAddDisableInfo": "你的认证来源是 {source}, 不支持添加 Passkey" }, diff --git a/src/router/profile/index.js b/src/router/profile/index.js index e0562b5e8..4642df1b4 100644 --- a/src/router/profile/index.js +++ b/src/router/profile/index.js @@ -1,5 +1,6 @@ import Layout from '@/layout' import i18n from '@/i18n/i18n' +import empty from '@/layout/empty.vue' export default { path: '/profile', @@ -54,15 +55,31 @@ export default { }, { path: '/profile/api-keys', - component: () => import('@/views/profile/ApiKey'), - name: 'ApiKey', + component: empty, meta: { - title: i18n.t('common.nav.APIKey'), - icon: 'key', - permissions: ['authentication.view_accesskey'], - resource: 'accesskey', - app: 'authentication' - } + icon: 'key' + }, + redirect: '', + children: [ + { + path: '', + component: () => import('@/views/profile/ApiKey'), + name: 'ApiKey', + icon: 'key', + meta: { title: i18n.t('common.nav.APIKey'), permissions: ['authentication.view_accesskey'] } + }, + { + path: ':id/update', + component: () => import('@/views/profile/ApiKeyCreateUpdate/index'), + name: 'ApiKeyCreateUpdate', + hidden: true, + meta: { + title: i18n.t('common.nav.APIKey'), + permissions: ['authentication.change_accesskey'], + activeMenu: '/profile/api-keys' + } + } + ] }, { path: '/profile/temp-password', diff --git a/src/views/profile/ApiKey.vue b/src/views/profile/ApiKey.vue index 23d6e5644..4a0bfffbc 100644 --- a/src/views/profile/ApiKey.vue +++ b/src/views/profile/ApiKey.vue @@ -33,7 +33,7 @@ + +