bug修改
This commit is contained in:
@@ -10,7 +10,9 @@ Page({
|
||||
confirmPassword: '',
|
||||
count: 60,
|
||||
rsaPublicKey: '',
|
||||
showGetCaptcha: true
|
||||
showGetCaptcha: true,
|
||||
show: true, // 默认显示的是闭眼睛
|
||||
showVerify: true,
|
||||
},
|
||||
|
||||
bindInputPhone(e) {
|
||||
@@ -18,6 +20,16 @@ Page({
|
||||
phone: e.detail.value
|
||||
})
|
||||
},
|
||||
showPassword(){
|
||||
this.setData({
|
||||
show: !this.data.show
|
||||
})
|
||||
},
|
||||
showPasswordVerify(){
|
||||
this.setData({
|
||||
showVerify: !this.data.showVerify
|
||||
})
|
||||
},
|
||||
// 获取验证码
|
||||
getVerCode() {
|
||||
countdown = 60
|
||||
@@ -116,7 +128,7 @@ Page({
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.password)){
|
||||
wx.showToast({
|
||||
title: '新密码由8位数字、大小写字母和特殊符号组成!',
|
||||
title: '新密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
@@ -128,7 +140,7 @@ Page({
|
||||
if(!e.detail.value.verifyPassword){
|
||||
this.data.flag = false
|
||||
wx.showToast({
|
||||
title: '请输入确认新密码',
|
||||
title: '请输入确认密码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -136,7 +148,7 @@ Page({
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.verifyPassword)){
|
||||
wx.showToast({
|
||||
title: '确认新密码由8位数字、大小写字母和特殊符号组成!',
|
||||
title: '确认密码由8位及以上数字、大小写字母和特殊符号组成!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
@@ -163,16 +175,22 @@ Page({
|
||||
rsaPublicKey: this.data.rsaPublicKey
|
||||
}
|
||||
// 修改密码
|
||||
UserApi.updatePassword(params).then(res => {
|
||||
UserApi.forgetPassword(params).then(res => {
|
||||
wx.showToast({
|
||||
title: '加载中...',
|
||||
icon: 'loading'
|
||||
})
|
||||
if (res.success) {
|
||||
// 跳转登录页
|
||||
wx.redirectTo({
|
||||
url: '../login/login',
|
||||
wx.showToast({
|
||||
title: '修改成功',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
// 跳转登录页
|
||||
wx.redirectTo({
|
||||
url: '../login/login',
|
||||
})
|
||||
}, 2000);
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
@@ -180,6 +198,12 @@ Page({
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
wx.showToast({
|
||||
title: err.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
},
|
||||
// 绑定微信
|
||||
|
||||
Reference in New Issue
Block a user