修复登录页跳转
This commit is contained in:
1 parent
85421399af
commit
2adaae4151
3 files changed
+12
-7
No files matched your search
@@ -42,4 +42,7 @@ VITE_APP_DEV_SERVICE = http://220.191.229.171:8090/api # 线上
|
||||
#VITE_APP_PROD_SERVICE = http://59.202.170.152:81/api
|
||||
# VITE_APP_PROD_SERVICE = https://stgl.pj.gov.cn/api
|
||||
VITE_APP_PROD_SERVICE = http://220.191.229.171:8090/api
|
||||
# ******************** end 生产环境 end ********************
|
||||
# ******************** end 生产环境 end ********************
|
||||
|
||||
VITE_DEV_ENV = dev
|
||||
# VITE_DEV_ENV = prod
|
||||
@@ -2,9 +2,7 @@
|
||||
import { reactive } from "vue"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import { isEmpty } from "radash"
|
||||
|
||||
import { filePath } from "@@/utils/file"
|
||||
|
||||
import { hooks, router, constant } from "@@/index"
|
||||
import { merchantApi, userApi, walletApi } from "@@/api"
|
||||
import isDevEnv from "@/sheep/utils/isDevEnv"
|
||||
@@ -25,7 +23,6 @@ const DEFAULT_SERVICES: ServiceItem[] = [
|
||||
{ text: "人脸管理", icon: "/static/icon/service_5.png", router: "/pages/human-face/list" },
|
||||
]
|
||||
|
||||
// 状态管理
|
||||
const state = reactive<any>({
|
||||
wallet: [],
|
||||
userInfo: {},
|
||||
@@ -66,8 +63,13 @@ const checkAppInfo = async () => {
|
||||
const zhengdingResult = await loginMethods.zhengdingLogin()
|
||||
if (zhengdingResult) return
|
||||
|
||||
const tokenKey = constant.storageConstant.TOKEN
|
||||
const userInfoKey = constant.storageConstant.USERINFO
|
||||
const tokenStorage = uni.getStorageSync(tokenKey)
|
||||
const userStorage = uni.getStorageSync(userInfoKey)
|
||||
|
||||
// 开发环境下跳转到测试登录页
|
||||
if (isDevEnv()) {
|
||||
if ((isDevEnv() && isEmpty(tokenStorage)) || isEmpty(userStorage)) {
|
||||
router.jump("/pages/test/login")
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// export default () => import.meta.env.VITE_DEV_ENV === "dev"
|
||||
export default () => process.env.NODE_ENV === "development"
|
||||
export default () => import.meta.env.VITE_DEV_ENV === "dev"
|
||||
// export default () => process.env.NODE_ENV === "development"
|
||||
Reference in new issue
Block a user