diff --git a/utils/http.js b/utils/http.js index 1a1330e..a3661d9 100644 --- a/utils/http.js +++ b/utils/http.js @@ -79,16 +79,18 @@ export const http = (options) => { } if (result.data.code === 400) { const userStore = useUserStore() - userStore.clearUserInfo() uni.showModal({ title: "登录失效", content: "点击确定跳转登录页面", confirmText: "确定", cancelText: "取消", success: (res) => { - uni.navigateTo({ - url: '/pages/start/login/login' - }) + if (res.confirm) { + userStore.clearUserInfo() + uni.navigateTo({ + url: '/pages/start/login/login' + }) + } }, }); }