This commit is contained in:
weiwei committed 2025-03-24 11:01:23 +08:00
1 parent ac6fc9245c
commit 7819d15326
2 files changed
+4 -7

No files matched your search

+3 -6
View File
@@ -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)
+1 -1
View File
@@ -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)