11
This commit is contained in:
1 parent
e3eb6d9b77
commit
cc39f190d0
7 files changed
+34
-8
No files matched your search
@@ -100,9 +100,9 @@ async function checkVerifyDevice() {
|
||||
const userInfo = uni.getStorageSync(constant.storageConstant.USERINFO)
|
||||
if (!userInfo || !userInfo.sysUser || !userInfo.sysUser.userId) return
|
||||
// 是否在白名单中
|
||||
// if (constant.DEVICE_VERIFY_WRITE_LIST.includes(userInfo.sysUser.phone)) {
|
||||
// return
|
||||
// }
|
||||
if (constant.DEVICE_VERIFY_WRITE_LIST.includes(userInfo.sysUser.phone)) {
|
||||
return
|
||||
}
|
||||
const _params = {
|
||||
mobile: userInfo.sysUser.phone,
|
||||
userId: userInfo.sysUser.userId,
|
||||
|
||||
@@ -7,4 +7,5 @@ export default {
|
||||
USER_SETTING: "user_setting",
|
||||
REMEMBER_USER: "remember_user",
|
||||
UNIQUE_CODE: "unique_code",
|
||||
LOGIN_IS_AGREE: "login_is_agree",
|
||||
}
|
||||
+11
-1
@@ -1,4 +1,4 @@
|
||||
import { APPENV } from "../constant"
|
||||
import { APPENV, storageConstant } from "../constant"
|
||||
|
||||
export const isDevEnv = (): boolean => process.env.NODE_ENV === "development"
|
||||
|
||||
@@ -64,3 +64,13 @@ export const createCooldown = (cooldownMs: number = 300) => {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const ceheckLogin = () => {
|
||||
const token = uni.getStorageSync(storageConstant.TOKEN)
|
||||
const userInfo = uni.getStorageSync(storageConstant.USERINFO)
|
||||
if (!token || !userInfo) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -25,7 +25,7 @@ console.log("getBaseApiUrl:", getBaseApiUrl())
|
||||
|
||||
const https = new Request({
|
||||
baseURL: getBaseApiUrl(),
|
||||
timeout: 10 * 1000,
|
||||
timeout: 15 * 1000,
|
||||
method: "GET",
|
||||
header: {
|
||||
Accept: "*/*",
|
||||
@@ -94,9 +94,9 @@ https.interceptors.response.use(
|
||||
if (currentRoute === "pages/root/login" || currentRoute === "/pages/root/login") {
|
||||
return
|
||||
}
|
||||
uni.removeStorageSync(TOKEN_KEY)
|
||||
uni.removeStorageSync(USER_INFO_KEY)
|
||||
runLoginRedirect(() => {
|
||||
uni.removeStorageSync(TOKEN_KEY)
|
||||
uni.removeStorageSync(USER_INFO_KEY)
|
||||
uni.showToast({ title: "登录已过期,请重新登录", icon: "none" })
|
||||
uni.navigateTo({ url: "/pages/root/login" })
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user