diff --git a/src/api/httpRequest3.js b/src/api/httpRequest3.js index 23d1c340..cc300aff 100644 --- a/src/api/httpRequest3.js +++ b/src/api/httpRequest3.js @@ -47,12 +47,12 @@ function service(options = {}) { url: '/pages/login/index' }) } - if (res.data.code == 1002000008) { - uni.setStorageSync('username',options.data.username) - uni.reLaunch({ - url: '/pages/setter/loginPwdUpdate' - }) - } + // if (res.data.code == 1002000008) { + // uni.setStorageSync('username',options.data.username) + // uni.reLaunch({ + // url: '/pages/setter/loginPwdUpdate' + // }) + // } if (res.data.msg) { if (res.data.msg.includes('get lock')) { reject("系统异常:状态码["+res.statusCode +"]\n"+"数据库死锁") diff --git a/src/pages/setter/passwordpage.vue b/src/pages/setter/passwordpage.vue index 8a2fa82d..339f0189 100644 --- a/src/pages/setter/passwordpage.vue +++ b/src/pages/setter/passwordpage.vue @@ -36,7 +36,7 @@ oldpassword: { rules: [{ required: true, - errorMessage: '请输入密码', + errorMessage: '请输入原密码', } ] }, @@ -44,26 +44,26 @@ newpassword: { rules: [{ required: true, - errorMessage: '请输入密码', + errorMessage: '请输入新密码', }, - { - minLength: 6, - maxLength: 20, - errorMessage: '密码长度在 {minLength} 到 {maxLength} 个字符', - } + // { + // minLength: 1, + // maxLength: 100, + // errorMessage: '密码长度在 {minLength} 到 {maxLength} 个字符', + // } ] }, // 对email字段进行必填验证 newpassword2: { rules: [{ required: true, - errorMessage: '请输入密码', - }, - { - minLength: 6, - maxLength: 20, - errorMessage: '密码长度在 {minLength} 到 {maxLength} 个字符', + errorMessage: '请输入新密码', }, + // { + // minLength: 1, + // maxLength: 100, + // errorMessage: '密码长度在 {minLength} 到 {maxLength} 个字符', + // }, { validateFunction:function(rule,value,data,callback){ console.log(value !== data.newpassword) @@ -91,11 +91,18 @@ // 触发提交表单 submit() { this.$refs.form.validate().then(res=>{ + uni.showLoading({ + title:"提交中", + mask:true + }) updateUserPwd(res.oldpassword,res.newpassword).then((ress)=>{ - console.log('返回结果:', ress); + uni.hideLoading() if(ress.data){ this.showCommitSuccessMessage("修改成功") } + }).catch(error=>{ + uni.hideLoading() + this.showErrorMessage(error) }) }).catch(err =>{ console.log('表单错误信息:', err); @@ -106,6 +113,10 @@ navigateBack(1) }) }, + showErrorMessage(hint) { + this.$refs.comMessage.showErrorMessage(hint, res => { + }) + }, } }