diff --git a/src/pages/tabbar/my.vue b/src/pages/tabbar/my.vue index 18e0617..d15bd16 100644 --- a/src/pages/tabbar/my.vue +++ b/src/pages/tabbar/my.vue @@ -132,12 +132,9 @@ const doLogin = async (loginType: number, token: string, accountId: string | nul case 2: if (isEmpty(tokenStorage) || isEmpty(userStorage)) { try { - uni.showLoading({ - title: "登录中...", - mask: true, - }) + uni.showLoading({ title: "登录中...", mask: true }) const res = await userApi.auth(token) - if (res?.code === 0) { + if (res.code == 0) { uni.setStorageSync(tokenKey, res.data) uni.hideLoading() uni.showToast({ title: "登录成功", icon: "none" }) @@ -182,7 +179,7 @@ const doScanCode = async () => { let decodedString: string | undefined = "" if (isDevEnv()) { decodedString = decodeBase64("eyJpZCI6IjE4ODk0ODM5Mzg0ODQ1MzEyMDEiLCJuYW1lIjoi5rWL6K+V6LaF5biCIn0=") - uni.showToast({ title: "开发环境不是浙政钉环境,扫码测试", icon: "none" }) + uni.showToast({ title: "开发环境不是浙政钉环境,扫码仅供测试", icon: "none" }) } else { const res: any = await (window as any).dd.scan({ type: "all" }) decodedString = decodeBase64(res.text) diff --git a/src/sheep/utils/request.ts b/src/sheep/utils/request.ts index 853a5b7..3d07e3a 100644 --- a/src/sheep/utils/request.ts +++ b/src/sheep/utils/request.ts @@ -157,7 +157,7 @@ http.interceptors.request.use(async (config) => { try { uni.showLoading({ title: "加载中...", mask: true }) const res = await userApi.auth(token) - if (res?.code === 0) { + if (res.code == 0) { uni.setStorageSync(TOKEN_KEY, res.data) const { data: userData } = await userApi.userInfo() uni.setStorageSync(USER_INFO_KEY, userData)