From 717382611d4562a226b30f17909fd3d0f5150010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=B1=E8=BE=BE?= Date: Wed, 13 Aug 2025 17:47:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(login):=20=E5=A2=9E=E5=8A=A0=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD=E5=92=8C=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E5=A4=84=E7=90=86-=20=E5=9C=A8=20user=20stor?= =?UTF-8?q?e=20=E4=B8=AD=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=A0=81=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91-=20?= =?UTF-8?q?=E5=9C=A8=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E8=BE=93=E5=85=A5=E6=A1=86=E5=92=8C?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=AF=86=E7=A0=81=E5=AF=B9=E8=AF=9D=E6=A1=86?= =?UTF-8?q?-=20=E5=AE=9E=E7=8E=B0=E5=BC=BA=E5=88=B6=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E7=9A=84=E5=8A=9F=E8=83=BD-=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.js | 12 ++++++++++-- src/views/app/login/index.vue | 15 ++++++++++++++- .../user/components/ResetPasswordDialog.vue | 17 +++++++++++++---- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index dafcada..02fffd4 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -53,12 +53,20 @@ const actions = { case 51001: // 需要发送 短信验证码 resolve({ - code: 51001 + code: numberResult }) break case 50024: + // 需要验证码 resolve({ - code: 50024, + code: numberResult, + message: res.content.resultMessage + }) + break + case 51003: + // 需要验证码 + resolve({ + code: numberResult, message: res.content.resultMessage }) break diff --git a/src/views/app/login/index.vue b/src/views/app/login/index.vue index fc95475..1b0eb59 100644 --- a/src/views/app/login/index.vue +++ b/src/views/app/login/index.vue @@ -117,6 +117,11 @@ :user-name="loginForm.userName" @handleSubmit="handleSubmit" > + + @@ -130,9 +135,11 @@ import { } from '@/api/app/user' import { setToken } from '@/assets/js/utils/auth' import uuid from 'uuid' +import ResetPasswordDialog from '@/views/system/user/components/ResetPasswordDialog.vue' // import { indexUser } from '@/api/app/user' export default { name: 'Login', + components: { ResetPasswordDialog }, data() { const validateuserName = (rule, value, callback) => { if (!validUsername(value)) { @@ -194,6 +201,7 @@ export default { loading: false, passwordType: 'password', redirect: undefined, + resetPasswordVisible: false, minute: 120 // 默认120秒 发送间隔 } }, @@ -302,7 +310,7 @@ export default { this.loading = false // this.sendPhoneCode() } - + // 展示验证码 if (res.code === 50024) { this.loading = false if (res.message) { @@ -310,6 +318,11 @@ export default { } this.getCaptChaCode() } + // 强制修改密码 + if (res.code === 51003) { + this.loading = false + this.resetPasswordVisible = true + } }) .catch(err => { if (this.captchaKey) { diff --git a/src/views/system/user/components/ResetPasswordDialog.vue b/src/views/system/user/components/ResetPasswordDialog.vue index 5446cc3..7b69f85 100644 --- a/src/views/system/user/components/ResetPasswordDialog.vue +++ b/src/views/system/user/components/ResetPasswordDialog.vue @@ -1,6 +1,5 @@