sc
This commit is contained in:
@@ -7,7 +7,6 @@ VITE_DEV=true
|
||||
# VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
# VITE_BASE_URL='http://114.215.207.150:48080'
|
||||
|
||||
# 上传路径
|
||||
|
||||
@@ -62,10 +62,23 @@ router.beforeEach(async (to, from, next) => {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next()
|
||||
} else {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
const tenantId = getTenantId() || to.query?.tenantId
|
||||
const appId = getAppId() || to.query?.appId
|
||||
if (tenantId && appId) {
|
||||
next(`/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
let redirectPath = to.fullPath
|
||||
const p = to.fullPath.split('?')
|
||||
if (p.length > 1) {
|
||||
// 过滤掉query参数中的tenantId和appId
|
||||
redirectPath =
|
||||
p[0] +
|
||||
'?' +
|
||||
p[1]
|
||||
.split('&')
|
||||
.filter((item) => !item.startsWith('tenantId=') && !item.startsWith('appId='))
|
||||
.join('&')
|
||||
}
|
||||
|
||||
next(`/login?tenantId=${tenantId}&appId=${appId}&redirect=${redirectPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
// next(`/login?redirect=${to.fullPath}`)
|
||||
// 否则全部重定向到平台登陆页
|
||||
|
||||
Reference in New Issue
Block a user