This commit is contained in:
qsh
2025-05-23 17:08:24 +08:00
parent 3aaa26fdc2
commit 4b030babe2
8 changed files with 187 additions and 42 deletions

View File

@@ -42,12 +42,9 @@ router.beforeEach(async (to, from, next) => {
if (to.path === '/login') {
if (to.query?.tenantId && to.query?.appId) {
setApp(to.query.tenantId, to.query.appId)
setTimeout(() => {
next({ path: '/' })
}, 1500)
} else {
next({ path: '/' })
await waitTime(1500)
}
next({ path: '/' })
} else {
// 获取所有字典
const dictStore = useDictStoreWithOut()
@@ -80,15 +77,23 @@ router.beforeEach(async (to, from, next) => {
const tenantId = getTenantId()
const appId = getAppId()
if (tenantId && appId) {
next(`/oa/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
next(`/crm/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
} else {
next(`/oa/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
next(`/crm/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
}
}
}
}
})
async function waitTime(seconds) {
return new Promise((resolve) => {
setTimeout(() => {
resolve()
}, seconds)
})
}
function setApp(tenantId, appId) {
setTenantId(tenantId)