diff --git a/core/core-frontend/src/permission.ts b/core/core-frontend/src/permission.ts index cc00868bab..5cf6757e0c 100644 --- a/core/core-frontend/src/permission.ts +++ b/core/core-frontend/src/permission.ts @@ -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) {