diff --git a/ui/src/layout/components/top-bar/avatar/ResetPasssword.vue b/ui/src/layout/components/top-bar/avatar/ResetPasssword.vue index eedb9e29e..c063eb7f2 100644 --- a/ui/src/layout/components/top-bar/avatar/ResetPasssword.vue +++ b/ui/src/layout/components/top-bar/avatar/ResetPasssword.vue @@ -41,8 +41,13 @@
- 获取验证码 + {{ isDisabled ? `重新发送(${time}s)` : '获取验证码' }}
@@ -77,6 +82,8 @@ const resetPasswordForm = ref({ const resetPasswordFormRef = ref() const loading = ref(false) +const isDisabled = ref(false) +const time = ref(60) const rules = ref>({ code: [{ required: true, message: '请输入验证码' }], @@ -123,9 +130,23 @@ const rules = ref>({ const sendEmail = () => { UserApi.sendEmailToCurrent(loading).then(() => { MsgSuccess('发送验证码成功') + isDisabled.value = true + handleTimeChange() }) } +const handleTimeChange = () => { + if (time.value <= 0) { + isDisabled.value = false + time.value = 60 + } else { + setTimeout(() => { + time.value-- + handleTimeChange() + }, 1000) + } +} + const open = () => { resetPasswordForm.value = { code: '', diff --git a/ui/src/views/applicaiton-overview/component/APIKeyDialog.vue b/ui/src/views/applicaiton-overview/component/APIKeyDialog.vue index d95bcaa34..347d7069e 100644 --- a/ui/src/views/applicaiton-overview/component/APIKeyDialog.vue +++ b/ui/src/views/applicaiton-overview/component/APIKeyDialog.vue @@ -24,7 +24,7 @@ {{ datetimeFormat(row.create_time) }} - +