Merge pull request #10005 from dataease/pr@dev-v2@fix_mobile_platform

fix(X-Pack): 第三方平台使用移动端免登进入pc版首页
This commit is contained in:
fit2cloud-chenyw 2024-05-31 16:33:39 +08:00 committed by GitHub
commit e30a604f5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,20 +29,24 @@ router.beforeEach(async (to, from, next) => {
start()
loadStart()
checkPlatform()
let isDesktop = wsCache.get('app.desktop')
if (isDesktop === null) {
await appStore.setAppModel()
isDesktop = appStore.getDesktop
}
if (isMobile()) {
done()
loadDone()
if (to.name === 'link') {
window.location.href = window.origin + '/mobile.html#' + to.path
} else if (!isPlatformClient() && !isLarkPlatform()) {
} else if (
wsCache.get('user.token') ||
isDesktop ||
(!isPlatformClient() && !isLarkPlatform())
) {
window.location.href = window.origin + '/mobile.html#/index'
}
}
let isDesktop = wsCache.get('app.desktop')
if (isDesktop === null) {
await appStore.setAppModel()
isDesktop = appStore.getDesktop
}
await appearanceStore.setAppearance()
if (wsCache.get('user.token') || isDesktop) {
if (!userStore.getUid) {