diff --git a/src/sheep/utils/request.ts b/src/sheep/utils/request.ts index 1d32324..a87a3e2 100644 --- a/src/sheep/utils/request.ts +++ b/src/sheep/utils/request.ts @@ -106,6 +106,26 @@ async function handleShLogin(): Promise { uni.showToast({ title: response.msg || "登录失败", icon: "none" }) } return false + + // if (response.data == -1) { + // uni.showToast({ title: "您的设备需要信任验证", icon: "none" }) + + // const pages = getCurrentPages() + // const currentPage = pages[pages.length - 1] + // const route = currentPage.route + // router.jump("/pages/user/deviceVerify", { redirect: route }) + + // return false + // } else { + // 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) { uni.showToast({ title: "登录错误", icon: "none" }) @@ -302,13 +322,13 @@ http.interceptors.response.use( } // 显示错误信息 - // if (error?.data?.msg) { - // uni.showToast({ - // title: error.data.msg, - // icon: "none", - // mask: true, - // }) - // } + if (error?.data?.msg) { + uni.showToast({ + title: error.data.msg, + icon: "none", + mask: true, + }) + } return Promise.resolve(error.data) }, )