request修改
This commit is contained in:
1 parent
c0707367a6
commit
ec0dfdec18
1 file changed
+27
-7
@@ -106,6 +106,26 @@ async function handleShLogin(): Promise<boolean> {
|
||||
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)
|
||||
},
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user