From 12241efafeea3e9591a183a83f99ce90e7cf5a34 Mon Sep 17 00:00:00 2001 From: chenwenchang <479999519@qq.com> Date: Thu, 28 Nov 2024 11:44:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E5=AF=86=E7=A0=81=E6=9C=AA?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=A0=A1=E9=AA=8C=E8=A7=84=E5=88=99=E7=A6=81?= =?UTF-8?q?=E6=AD=A2=E6=8F=90=E4=BA=A4=20#8250=20#=20Reviewed,=20transacti?= =?UTF-8?q?on=20id:=2025143?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/frontend/src/locales/zh-cn.json | 1 + .../db-manage/common/password-input/Index.vue | 13 ++++++++++- .../components/common/AccountCreate.vue | 22 +++++++++++++++++-- .../views/db-manage/redis/apply-ha/Index.vue | 13 ++++++++++- .../db-manage/redis/apply/ApplyRedis.vue | 13 ++++++++++- .../index/Index.vue | 18 +++++++++++---- 6 files changed, 71 insertions(+), 9 deletions(-) diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index 569ac4af87..8a5306d8f3 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3655,5 +3655,6 @@ "全站搜索,支持多对象,Shift + Enter 换行,Enter键开启搜索": "全站搜索,支持多对象,Shift + Enter 换行,Enter键开启搜索", "全站搜索,支持多对象,Enter开启搜索": "全站搜索,支持多对象,Enter开启搜索", "同主机关联的其他集群,勾选后一并添加": "同主机关联的其他集群,勾选后一并添加", + "密码不符合规则": "密码不符合规则", "这行勿动!新增翻译请在上一行添加!": "" } diff --git a/dbm-ui/frontend/src/views/db-manage/common/password-input/Index.vue b/dbm-ui/frontend/src/views/db-manage/common/password-input/Index.vue index 2a42c3e580..3eab123785 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/password-input/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/password-input/Index.vue @@ -71,6 +71,10 @@ buttonDisabledTip?: string; } + interface Emits { + (e: 'verifyResult', isPass: boolean): void; + } + interface Exposes { getEncyptPassword: () => string; validate: () => Promise; @@ -82,12 +86,14 @@ buttonDisabledTip: '', }); - const { t } = useI18n(); + const emits = defineEmits(); const modelValue = defineModel('modelValue', { default: '', }); + const { t } = useI18n(); + let tippyInstance: Instance; let publicKey = ''; let passwordPolicyMemo = {} as PasswordPolicy['rule']; @@ -256,6 +262,7 @@ password: getEncyptPassword(), }); tippyInstance.show(); + emits('verifyResult', isStrength); return isStrength; }; const debounceVerifyPassword = _.debounce(verifyPassword, 300); @@ -294,6 +301,10 @@ tippyInstance.hide(); }; + watch(modelValue, () => { + debounceVerifyPassword(); + }); + onUnmounted(() => { tippyInstance.destroy(); }); diff --git a/dbm-ui/frontend/src/views/db-manage/common/permission/components/common/AccountCreate.vue b/dbm-ui/frontend/src/views/db-manage/common/permission/components/common/AccountCreate.vue index aaead0bff1..e1320634ba 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/permission/components/common/AccountCreate.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/permission/components/common/AccountCreate.vue @@ -54,7 +54,8 @@ + :db-type="dbTypeMap[accountType]" + @verify-result="verifyResult" />

{{ t('平台不会保存密码,请自行保管好。') }}