refactor(login): 优化忘记密码功能的逻辑和提示

-增加对服务器返回 code 的判断,确保只有在 code 为 0 时才显示成功提示
- 调整用户错误提示的显示方式,使用 uni.showToast 替代 uni.showModal
- 优化异常处理,统一异常提示的显示格式
dev
10396 2025-07-04 08:49:07 +08:00
parent bf7e5d3709
commit 587651761b
1 changed files with 24 additions and 21 deletions

View File

@ -142,8 +142,10 @@
uni.hideLoading();//
this.buttonloading = false
if (res.data != null) {
var code = res.data.code;
var result = res.data.result;
if("success"===result){
if ("0" === code) {
uni.showToast({
title: "密码修改成功",
duration: 1500, //
@ -157,13 +159,14 @@
}
});
} else if ("usererror" == result) {
} else if ("9999" === code) {
uni.showToast({
icon: 'none',
title: "旧密码有误",
duration: 2000
});
}else if ("exception" == result) {
}
} else if ("exception" === result) {
uni.showToast({
icon: 'none',
title: res.data.exception,