Browse Source

修改密码修改

hella_online_20241205
lijuncheng 2 months ago
parent
commit
31ad6b60f2
  1. 12
      src/api/httpRequest3.js
  2. 39
      src/pages/setter/passwordpage.vue

12
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"+"数据库死锁")

39
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 => {
})
},
}
}
</script>

Loading…
Cancel
Save