forked from wangziqi/gongxue-base
fix: guard admin h5 entry pages
This commit is contained in:
@@ -3,7 +3,7 @@ import Taro from '@tarojs/taro';
|
||||
import { Button, Text, View } from '@tarojs/components';
|
||||
import { appEnv, assertFrontendSecretsAreAbsent, ensureRuntimeConfigLoaded, isH5Runtime } from '@/env';
|
||||
import { resolveTenant } from '@/services/api';
|
||||
import { landingPath, requireSignedIn } from '@/services/routeGuard';
|
||||
import { landingPath, requirePlatformAdmin, requireTenantAdmin } from '@/services/routeGuard';
|
||||
import './index.css';
|
||||
|
||||
function hostFromRuntime() {
|
||||
@@ -22,7 +22,8 @@ export default function BootstrapPage() {
|
||||
.then(async () => {
|
||||
if (appEnv.portal === 'student') return null;
|
||||
setStatus('正在校验登录状态');
|
||||
return requireSignedIn(landingPath());
|
||||
if (appEnv.portal === 'platform-admin') return requirePlatformAdmin(landingPath());
|
||||
return requireTenantAdmin(landingPath());
|
||||
})
|
||||
.then(authPayload => {
|
||||
if (appEnv.portal !== 'student' && !authPayload) return;
|
||||
|
||||
Reference in New Issue
Block a user