qsh 1 month ago
parent c786995532
commit 183416a1b3
  1. 1
      .env.base
  2. 19
      src/permission.js

@ -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}`)
// 否则全部重定向到平台登陆页

Loading…
Cancel
Save