From 00c0ca7642bde3d45ab606d5b4ea4f63d76dacf3 Mon Sep 17 00:00:00 2001 From: weiwei Date: Wed, 9 Apr 2025 15:11:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/tabbar/my.vue | 6 +++++- src/sheep/utils/request.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/tabbar/my.vue b/src/pages/tabbar/my.vue index 082693d..59ae978 100644 --- a/src/pages/tabbar/my.vue +++ b/src/pages/tabbar/my.vue @@ -182,7 +182,11 @@ const login = { } else { uni.hideLoading() storage.clearUserStorage() - uni.showToast({ title: "登录失败", icon: "none" }) + if (response.msg == "token已失效") { + uni.showToast({ title: "用户凭证已失效,请退出并重新进入智慧后勤应用", icon: "none", duration: 6000 }) + } else { + uni.showToast({ title: response.msg || "登录失败", icon: "none" }) + } } break diff --git a/src/sheep/utils/request.ts b/src/sheep/utils/request.ts index d071c9a..3f76b23 100644 --- a/src/sheep/utils/request.ts +++ b/src/sheep/utils/request.ts @@ -94,9 +94,13 @@ async function handleShLogin(): Promise { uni.showToast({ title: "登录成功", icon: "none" }) return true } else { - uni.showToast({ title: "获取用户信息失败", icon: "none" }) uni.removeStorageSync(TOKEN_KEY) uni.removeStorageSync(USER_INFO_KEY) + if (response.msg == "token已失效") { + uni.showToast({ title: "用户凭证已失效,请退出并重新进入智慧后勤应用", icon: "none", duration: 6000 }) + } else { + uni.showToast({ title: response.msg || "登录失败", icon: "none" }) + } return false } } catch (error) {