refactor(login): 优化忘记密码功能的逻辑和提示
-增加对服务器返回 code 的判断,确保只有在 code 为 0 时才显示成功提示 - 调整用户错误提示的显示方式,使用 uni.showToast 替代 uni.showModal - 优化异常处理,统一异常提示的显示格式dev
parent
bf7e5d3709
commit
587651761b
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue