diff --git a/huakai-app/pageSubPack/api/request.js b/huakai-app/pageSubPack/api/request.js index 1f0df05..fb0f56d 100644 --- a/huakai-app/pageSubPack/api/request.js +++ b/huakai-app/pageSubPack/api/request.js @@ -42,10 +42,21 @@ export default function request(url, data = {}, method = "GET") { const resData = res.data || {}; - // token 过期 — 静默清除登录态,不强制跳转登录页 + // token 过期 — 清除登录态,提示用户,但不强制跳转(用户可继续浏览非敏感页面) if (resData.code === 401) { + uni.showToast({ title: '登录已过期,请重新登录', icon: 'none', duration: 2000 }); uni.removeStorageSync('token'); uni.removeStorageSync('userId'); + // 使用 navigateTo 而非 reLaunch,用户可通过返回按钮退出登录页 + setTimeout(() => { + uni.navigateTo({ + url: '/pageSubPack/loginSub/pwd-login', + fail: () => { + // 如果 navigateTo 失败(如页面栈满),则用 reLaunch + uni.reLaunch({ url: '/pageSubPack/loginSub/pwd-login' }); + } + }); + }, 1500); reject({ msg: '登录过期', code: 401 }); return; } diff --git a/huakai-app/pageSubPack/loginSub/login.vue b/huakai-app/pageSubPack/loginSub/login.vue index 24acf9b..fcc2c69 100644 --- a/huakai-app/pageSubPack/loginSub/login.vue +++ b/huakai-app/pageSubPack/loginSub/login.vue @@ -115,7 +115,7 @@ const handleCancel = () => { if (pages.length > 1) { uni.navigateBack(); } else { - uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); + uni.redirectTo({ url: '/pages/arrearsPayment/arrearsPayment' }); } }; @@ -204,7 +204,7 @@ const handleLogin = () => { // 登录成功后返回来源页 uni.navigateBack({ fail: () => { - uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); + uni.redirectTo({ url: '/pages/arrearsPayment/arrearsPayment' }); } }); },1500) diff --git a/huakai-app/pageSubPack/loginSub/pwd-login.vue b/huakai-app/pageSubPack/loginSub/pwd-login.vue index 6ec4fa2..08a351a 100644 --- a/huakai-app/pageSubPack/loginSub/pwd-login.vue +++ b/huakai-app/pageSubPack/loginSub/pwd-login.vue @@ -117,7 +117,7 @@ const handleCancel = () => { if (pages.length > 1) { uni.navigateBack(); } else { - uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); + uni.redirectTo({ url: '/pages/arrearsPayment/arrearsPayment' }); } }; @@ -166,7 +166,7 @@ const handleLogin = () => { // 登录成功后返回来源页 uni.navigateBack({ fail: () => { - uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); + uni.redirectTo({ url: '/pages/arrearsPayment/arrearsPayment' }); } }); },1000) diff --git a/huakai-app/pageSubPack/payment-list/addHydropower.vue b/huakai-app/pageSubPack/payment-list/addHydropower.vue deleted file mode 100644 index cc7637f..0000000 --- a/huakai-app/pageSubPack/payment-list/addHydropower.vue +++ /dev/null @@ -1,545 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/huakai-app/pageSubPack/payment-list/addPayment.vue b/huakai-app/pageSubPack/payment-list/addPayment.vue deleted file mode 100644 index e62f7e1..0000000 --- a/huakai-app/pageSubPack/payment-list/addPayment.vue +++ /dev/null @@ -1,522 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/huakai-app/pageSubPack/payment-list/addPaymentSuccess.vue b/huakai-app/pageSubPack/payment-list/addPaymentSuccess.vue deleted file mode 100644 index 5e219b6..0000000 --- a/huakai-app/pageSubPack/payment-list/addPaymentSuccess.vue +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/huakai-app/pageSubPack/payment-list/noArrearsPayment.vue b/huakai-app/pageSubPack/payment-list/noArrearsPayment.vue deleted file mode 100644 index 5a5e97d..0000000 --- a/huakai-app/pageSubPack/payment-list/noArrearsPayment.vue +++ /dev/null @@ -1,482 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/huakai-app/pageSubPack/payment-list/paymentRecord.vue b/huakai-app/pageSubPack/payment-list/paymentRecord.vue deleted file mode 100644 index 64daa6e..0000000 --- a/huakai-app/pageSubPack/payment-list/paymentRecord.vue +++ /dev/null @@ -1,397 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/huakai-app/pageSubPack/payment-list/selectPaymentEntity.vue b/huakai-app/pageSubPack/payment-list/selectPaymentEntity.vue deleted file mode 100644 index 53beb52..0000000 --- a/huakai-app/pageSubPack/payment-list/selectPaymentEntity.vue +++ /dev/null @@ -1,376 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/huakai-app/pages.json b/huakai-app/pages.json index 97fdb16..1c1575b 100644 --- a/huakai-app/pages.json +++ b/huakai-app/pages.json @@ -8,52 +8,52 @@ } ], "subPackages": [ - // { - // "root": "pageSubPack/loginSub", - // "pages": [ - // { - // "path": "register-new-user", - // "style": { - // "navigationBarTitleText": "注册新用户", - // "navigationStyle": "custom" - // } - // }, - // { - // "path": "pwd-login", - // "style": { - // "navigationBarTitleText": "账号密码登录", - // "navigationStyle": "custom" - // } - // }, - // { - // "path": "login", - // "style": { - // "navigationBarTitleText": "验证码登录", - // "navigationStyle": "custom" - // } - // }, - // { - // "path": "forget-pwd", - // "style": { - // "navigationBarTitleText": "忘记密码", - // "navigationStyle": "custom" - // } - // }, - // { - // "path": "change-pwd", - // "style": { - // "navigationBarTitleText": "修改密码", - // "navigationStyle": "custom" - // } - // }, - // { - // "path": "privacy", - // "style": { - // "navigationBarTitleText": "用户隐私政策" - // } - // } - // ] - // }, + { + "root": "pageSubPack/loginSub", + "pages": [ + { + "path": "register-new-user", + "style": { + "navigationBarTitleText": "注册新用户", + "navigationStyle": "custom" + } + }, + { + "path": "pwd-login", + "style": { + "navigationBarTitleText": "账号密码登录", + "navigationStyle": "custom" + } + }, + { + "path": "login", + "style": { + "navigationBarTitleText": "验证码登录", + "navigationStyle": "custom" + } + }, + { + "path": "forget-pwd", + "style": { + "navigationBarTitleText": "忘记密码", + "navigationStyle": "custom" + } + }, + { + "path": "change-pwd", + "style": { + "navigationBarTitleText": "修改密码", + "navigationStyle": "custom" + } + }, + { + "path": "privacy", + "style": { + "navigationBarTitleText": "用户隐私政策" + } + } + ] + }, { "root": "pageSubPack/payment-list", "pages": [ diff --git a/huakai-app/pages/paymentIndex/paymentIndex.vue b/huakai-app/pages/paymentIndex/paymentIndex.vue deleted file mode 100644 index 439b110..0000000 --- a/huakai-app/pages/paymentIndex/paymentIndex.vue +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - -