diff --git a/pages/login/forget/forget-reset.vue b/pages/login/forget/forget-reset.vue index d63fd4c..895400c 100644 --- a/pages/login/forget/forget-reset.vue +++ b/pages/login/forget/forget-reset.vue @@ -142,28 +142,31 @@ uni.hideLoading();//结束加载中动画 this.buttonloading = false if (res.data != null) { - var result = res.data.result; - if ("success" === result) { - uni.showToast({ - title: "密码修改成功", - duration: 1500, // 适当延长显示时间 - success: function() { - // 使用 setTimeout 确保提示框完全显示后再跳转 - setTimeout(function() { - uni.navigateTo({ - url: '/pages/login/home', - }); - }, 1500); // 延迟时间与 duration 一致或略长 - } - }); + var code = res.data.code; + var result = res.data.result; + if("success"===result){ + if ("0" === code) { + uni.showToast({ + title: "密码修改成功", + duration: 1500, // 适当延长显示时间 + success: function() { + // 使用 setTimeout 确保提示框完全显示后再跳转 + setTimeout(function() { + uni.navigateTo({ + url: '/pages/login/home', + }); + }, 1500); // 延迟时间与 duration 一致或略长 + } + }); - } else if ("usererror" == result) { - uni.showToast({ - icon: 'none', - title: "旧密码有误", - duration: 2000 - }); - }else if ("exception" == result) { + } else if ("9999" === code) { + uni.showToast({ + icon: 'none', + title: "旧密码有误", + duration: 2000 + }); + } + } else if ("exception" === result) { uni.showToast({ icon: 'none', title: res.data.exception,