From 0e625655fa2ce93e8fe50ca11fbccbfbac18e010 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 15:50:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(user):=20=E6=96=B0=E5=A2=9E=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E9=AA=8C=E8=AF=81=E7=A0=81=E5=8F=91=E9=80=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD-=20=E5=9C=A8=20user.js=20=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20send=5Fsms=20=E6=96=B9=E6=B3=95-=20=E5=9C=A8=20system.js=20?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=20verifyUpdatePassword=20=E6=96=B9?= =?UTF-8?q?=E6=B3=95-=20=E6=96=B0=E5=A2=9E=20send-phone-code.vue=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E7=94=A8=E4=BA=8E=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=92=8C=E9=AA=8C=E8=AF=81=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81-=20=E4=BF=AE=E6=94=B9=20login.vue=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=96=B0=E7=9A=84=20send-phone-code=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=9B=BF=E6=8D=A2=E5=8E=9F=E6=9C=89=E7=9F=AD=E4=BF=A1?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E9=80=BB=E8=BE=91-=20=E6=9B=B4=E6=96=B0=20Re?= =?UTF-8?q?setPasswordDialog.vue=EF=BC=8C=E9=9B=86=E6=88=90=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E9=AA=8C=E8=AF=81=E7=A0=81=E9=AA=8C=E8=AF=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/app/user.js | 6 + src/api/generatedApi/system.js | 8 + src/generatedComponents/send-phone-code.vue | 197 ++++++++++++++++++ src/views/app/login/index.vue | 106 ++-------- .../employRule/index.vue | 47 ++--- .../user/components/ResetPasswordDialog.vue | 157 ++++++++------ 6 files changed, 345 insertions(+), 176 deletions(-) create mode 100644 src/generatedComponents/send-phone-code.vue diff --git a/src/api/app/user.js b/src/api/app/user.js index 4dbef8e..fa0342b 100644 --- a/src/api/app/user.js +++ b/src/api/app/user.js @@ -49,6 +49,12 @@ export function sendPhoneCodeLogin(data) { data }) } +export function send_sms() { + return request({ + url: getUrl('/sysUserEx/send_sms'), + method: 'get' + }) +} export function verify_login(data) { return request({ url: getUrl('/sysUserEx/verify_login'), diff --git a/src/api/generatedApi/system.js b/src/api/generatedApi/system.js index dd6a223..10e3167 100644 --- a/src/api/generatedApi/system.js +++ b/src/api/generatedApi/system.js @@ -62,6 +62,14 @@ export function updatePassword(data) { return request({ url: getUrl(`/sysUserEx/updatePassword`), method: 'post', + data, + back: true + }) +} +export function verifyUpdatePassword(data) { + return request({ + url: getUrl(`/sysUserEx/verifyUpdatePassword`), + method: 'post', data }) } diff --git a/src/generatedComponents/send-phone-code.vue b/src/generatedComponents/send-phone-code.vue new file mode 100644 index 0000000..644a03b --- /dev/null +++ b/src/generatedComponents/send-phone-code.vue @@ -0,0 +1,197 @@ + + + diff --git a/src/views/app/login/index.vue b/src/views/app/login/index.vue index 18a469f..fc95475 100644 --- a/src/views/app/login/index.vue +++ b/src/views/app/login/index.vue @@ -112,68 +112,11 @@ - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - -
-
- -
+ :user-name="loginForm.userName" + @handleSubmit="handleSubmit" + > @@ -306,21 +249,17 @@ export default { } }) }, - handleSubmit() { - this.$refs.phoneForm.validate(valid => { - if (valid) { - verify_login({ - smsCode: this.phoneForm.code, - userName: this.loginForm.userName - }).then(vali => { - if (Number(vali.code) === 0) { - this.$store.commit('user/SET_TOKEN', vali.content.content.sid) - setToken(vali.content.content.sid) - localStorage.setItem('deviceId', vali.content.content.deviceId) - this.$router.push({ path: '/home' }) - this.loading = false - } - }) + handleSubmit(code) { + verify_login({ + smsCode: code, + userName: this.loginForm.userName + }).then(vali => { + if (Number(vali.code) === 0) { + this.$store.commit('user/SET_TOKEN', vali.content.content.sid) + setToken(vali.content.content.sid) + localStorage.setItem('deviceId', vali.content.content.deviceId) + this.$router.push({ path: '/home' }) + this.loading = false } }) }, @@ -428,20 +367,7 @@ $cursor: #fff; font-style: normal; } } -.phone-form { - & .el-input-group__append { - background: $--color-primary; - color: #fff; - border-color: $--color-primary; - & .el-button { - &.is-disabled { - & ~ .el-input-group__append { - background: $--color-primary-disabled; - } - } - } - } -} + .login-input { position: relative; border: 1px solid #eaecf5; diff --git a/src/views/applicationManagement/employRule/index.vue b/src/views/applicationManagement/employRule/index.vue index c9a5eb9..c358759 100644 --- a/src/views/applicationManagement/employRule/index.vue +++ b/src/views/applicationManagement/employRule/index.vue @@ -238,14 +238,30 @@ export default { } }, // 获取规则列表数据 - getList(queryParams) { + getList() { + const queryParams = Object.assign({}, this.queryParams) this.loading = true - const params = Object.assign( - {}, - queryParams ? queryParams : this.queryParams - ) + // 如果ruleType是中文,转换为编码值 + if (queryParams && queryParams.ruleType) { + const ruleTypeItem = this.ruleTypeList.find( + item => item.typeCode === queryParams.ruleType + ) - getRulePage(params) + if (queryParams && ruleTypeItem) { + queryParams.ruleType = ruleTypeItem.typeName + } + } + + // 如果ruleField是中文,转换为编码值 + if (queryParams && queryParams.ruleField) { + const fieldTypeItem = this.fieldTypeList.find( + item => item.fieldName === queryParams.ruleField + ) + if (queryParams && fieldTypeItem) { + queryParams.ruleField = fieldTypeItem.fieldComment + } + } + getRulePage(queryParams) .then(response => { // 根据实际API返回结构调整,兼容Vue2语法 var content = response.content.content || {} @@ -331,25 +347,6 @@ export default { this.queryParams.page = 1 // 创建查询参数的副本 const queryParams = Object.assign({}, this.queryParams) - // 如果ruleType是中文,转换为编码值 - if (queryParams.ruleType) { - const ruleTypeItem = this.ruleTypeList.find( - item => item.typeCode === queryParams.ruleType - ) - if (ruleTypeItem) { - queryParams.ruleType = ruleTypeItem.typeName - } - } - - // 如果ruleField是中文,转换为编码值 - if (queryParams.ruleField) { - const fieldTypeItem = this.fieldTypeList.find( - item => item.fieldName === queryParams.ruleField - ) - if (fieldTypeItem) { - queryParams.ruleField = fieldTypeItem.fieldComment - } - } // 使用转换后的参数进行查询 // this.queryParams = queryParams diff --git a/src/views/system/user/components/ResetPasswordDialog.vue b/src/views/system/user/components/ResetPasswordDialog.vue index 76204e8..5446cc3 100644 --- a/src/views/system/user/components/ResetPasswordDialog.vue +++ b/src/views/system/user/components/ResetPasswordDialog.vue @@ -1,68 +1,78 @@