From fac8ace35a5e6e5c71d7086c1092d5bd7d8cf932 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Mon, 4 Mar 2024 14:16:25 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../top-bar/avatar/ResetPasssword.vue | 25 ++++++++- .../component/APIKeyDialog.vue | 2 +- .../component/ImportDocumentDialog.vue | 51 +++++++++++-------- ui/src/views/document/index.vue | 2 +- ui/src/views/hit-test/index.vue | 2 +- ui/src/views/log/index.vue | 6 +-- ui/src/views/login/forgot-password/index.vue | 2 + 7 files changed, 61 insertions(+), 29 deletions(-) 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) }} - +