bug修改

This commit is contained in:
姚亚男
2021-10-22 18:03:14 +08:00
parent dcc0e8b1fa
commit c15d7ca29b
16 changed files with 137 additions and 128 deletions
+13 -31
View File
@@ -13,35 +13,17 @@ Page({
rsaPublicKey: '',
flag: false,
show: true, // 默认显示的是闭眼睛
showVerify: true,
type: 'password',
typeVerify: 'password'
showVerify: true
},
showPassword(){
if(this.data.show){ // 显示睁开眼睛的时候 type="text"
this.setData({
type: 'text',
show: false
})
}else{
this.setData({
type: 'password',
show: true
})
}
this.setData({
show: !this.data.show
})
},
showPasswordVerify(){
if(this.data.showVerify){ // 显示睁开眼睛的时候 type="text"
this.setData({
typeVerify: 'text',
showVerify: false
})
}else{
this.setData({
typeVerify: 'password',
showVerify: true
})
}
this.setData({
showVerify: !this.data.showVerify
})
},
// 登录
formSubmit(e) {
@@ -57,7 +39,7 @@ Page({
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
if(!pattern.test(e.detail.value.newPassword)){
wx.showToast({
title: '密码由8位数字、大小写字母和特殊符号组成!',
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
icon: 'none'
})
this.data.flag = false
@@ -77,7 +59,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
@@ -98,9 +80,9 @@ Page({
}
if (this.data.flag) {
let params = {
password: this.data.password,
newPassword: encrypt(this.data.rsaPublicKey, e.detail.value.newPassword),
verifyPassword: encrypt(this.data.rsaPublicKey, e.detail.value.verifyPassword),
password: this.data.password, // token
newPassword: encrypt(this.data.rsaPublicKey, e.detail.value.newPassword), // 密码
verifyPassword: encrypt(this.data.rsaPublicKey, e.detail.value.verifyPassword), // 确认密码
rsaPublicKey: this.data.rsaPublicKey
}
// 请求短信登录start
@@ -122,7 +104,7 @@ Page({
})
} else {
wx.showToast({
title: '登录失败',
title: res.message,
icon: 'error',
duration: 2000
})