fix: tighten H5 portal guard and legacy home stats

This commit is contained in:
Codex
2026-07-02 03:12:30 +08:00
parent 25ccaea873
commit e6735b58da
5 changed files with 156 additions and 12 deletions

View File

@@ -25,6 +25,18 @@
window.location.replace('/pages/bootstrap/index?redirect=' + encodeURIComponent('/'));
return;
}
if (portal === 'student' && path.indexOf('/pages/') === 0 && path.indexOf('/pages/student/') !== 0 && path.indexOf('/pages/bootstrap/') !== 0) {
window.location.replace('/pages/bootstrap/index?redirect=' + encodeURIComponent('/pages/student/home/index'));
return;
}
if (portal === 'tenant-admin' && path.indexOf('/pages/') === 0 && path.indexOf('/pages/tenant-admin/') !== 0 && path.indexOf('/pages/bootstrap/') !== 0 && path.indexOf('/pages/student/login/') !== 0) {
window.location.replace('/pages/bootstrap/index?redirect=' + encodeURIComponent('/pages/tenant-admin/workbench/index'));
return;
}
if (portal === 'platform-admin' && path.indexOf('/pages/') === 0 && path.indexOf('/pages/platform-admin/') !== 0 && path.indexOf('/pages/bootstrap/') !== 0 && path.indexOf('/pages/student/login/') !== 0) {
window.location.replace('/pages/bootstrap/index?redirect=' + encodeURIComponent('/pages/platform-admin/workbench/index'));
return;
}
if (path.indexOf('/pages/student/') === 0 && !publicStudentPaths[path]) {
window.location.replace('/pages/bootstrap/index?redirect=' + encodeURIComponent(redirect));
return;