forked from wangziqi/gongxue-base
style: tighten H5 guards and legacy student UI
This commit is contained in:
@@ -16,12 +16,15 @@
|
||||
var path = window.location.pathname || '';
|
||||
var portal = '<%= process.env.TARO_APP_PORTAL || "student" %>';
|
||||
var redirect = path + (window.location.search || '');
|
||||
var isRootEntry = !path || path === '/' || /\/index\.html$/.test(path);
|
||||
var publicStudentPaths = {
|
||||
'/pages/student/login/index': true,
|
||||
'/pages/student/region/index': true,
|
||||
'/pages/student/catalog/index': true,
|
||||
'/pages/student/scoreline/index': true
|
||||
'/pages/student/region/index': true
|
||||
};
|
||||
if (isRootEntry) {
|
||||
window.location.replace('/pages/bootstrap/index?redirect=' + encodeURIComponent('/'));
|
||||
return;
|
||||
}
|
||||
if (path.indexOf('/pages/student/') === 0 && !publicStudentPaths[path]) {
|
||||
window.location.replace('/pages/bootstrap/index?redirect=' + encodeURIComponent(redirect));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user