From 7973b179afdb095bbb1df56a906ac0588bb25d32 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 1 Apr 2025 17:34:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E8=BF=87=E6=9C=9F=E5=8A=9F=E8=83=BD=E6=94=AF=E6=8C=81=EF=BC=8C?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E6=9C=89=E6=95=88=E6=9C=9F=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ForcePasswdChange/index.vue | 35 +++++++++++++++++----- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/components/ForcePasswdChange/index.vue b/src/components/ForcePasswdChange/index.vue index bd9c0ec4..52d65f2f 100644 --- a/src/components/ForcePasswdChange/index.vue +++ b/src/components/ForcePasswdChange/index.vue @@ -23,6 +23,7 @@ type ModalStateType = { /**密码策略 */ passwordPolicy: Record; /**密码有效期 */ + passwdExpireEnable: boolean; passwdExpire: Record; }; @@ -37,6 +38,7 @@ let modalState: ModalStateType = reactive({ }, confirmLoading: false, passwordPolicy: { minLength: 8, specialChars: 2, uppercase: 1, lowercase: 1 }, + passwdExpireEnable: false, passwdExpire: { expHours: 2, alertHours: 1 }, }); @@ -74,6 +76,7 @@ function fnModalOk() { updateUserPasswordForce(password).then(res => { if (res.code === RESULT_CODE_SUCCESS) { userStore.fnLogOut(); + modalState.confirmLoading = true; Modal.success({ title: t('common.tipTitle'), content: t('views.account.settings.submitOkTip', { @@ -108,7 +111,20 @@ onMounted(() => { } if (resArr[1].code === RESULT_CODE_SUCCESS) { try { - modalState.passwdExpire = JSON.parse(resArr[1].data); + const data = JSON.parse(resArr[1].data); + if (data.expHours % 24 === 0) { + data.expHours = data.expHours / 24; + } else { + data.expHours = (data.expHours / 24).toFixed(2); + } + if (data.alertHours % 24 === 0) { + data.alertHours = data.alertHours / 24; + } else { + data.alertHours = (data.alertHours / 24).toFixed(2); + } + console.log(data); + modalState.passwdExpire = data; + modalState.passwdExpireEnable = data.expHours > 0; } catch (error) { console.error('passwdExpire', error); } @@ -155,6 +171,7 @@ onUnmounted(() => {}); >