修复了忘记密码和重置密码的bug

This commit is contained in:
chen-xin-zhi 2025-06-04 01:19:38 +08:00
parent 361f6a89d3
commit e485cae219
3 changed files with 8 additions and 5 deletions

View File

@ -1,7 +1,7 @@
{
"pages": [
"pages/personCenter/mine/mine",
"pages/loginModule/pwdLogin/pwdLogin",
"pages/personCenter/mine/mine",
"pages/personCenter/subCommissionSetting/subCommissionSetting",
"pages/test/testVideo/testVideo",
"pages/personCenter/withdrawal/withdrawal",

View File

@ -103,19 +103,21 @@ Page({
// 3. 格式校验手机号
if (!/^1\d{10}$/.test(phone)) {
return wx.showToast({ title: '手机号格式不正确', icon: 'none' });
}
}
// 2. 密码一致
if (newPwd !== confirmPwd) {
return wx.showToast({ title: '两次密码不一致', icon: 'none' });
}
// 4. 发起重置请求
wx.request({
url: baseUrl + '/userInfo/mini/forgetPwd',
url: baseUrl + '/userInfo/mini/out/reset/pwd',
method: 'POST',
data: {
phoneNumber: phone,
verificationCode: code,
newPassword: newPwd
userPassword: newPwd,
userConfirmPassword: confirmPwd,
sourceToken: null
},
success: res => {
if (res.data.code === 1) {

View File

@ -29,7 +29,8 @@ Page({
phoneNumber: phone,
verificationCode: verificationCode,
userPassword: password,
userConfirmPassword: currentPwd
userConfirmPassword: currentPwd,
sourceToken: wx.getStorageSync('token')
},
success: res => {
console.log('修改密码--->',res);