|
@@ -1,4 +1,5 @@
|
|
|
import { getSessionID, getConfig } from '@/utils/auth';
|
|
|
+import { setItem } from '@/utils/storage';
|
|
|
|
|
|
import NProgress from 'nprogress';
|
|
|
import 'nprogress/nprogress.css';
|
|
@@ -23,6 +24,8 @@ export function setupRouterGuard(router) {
|
|
|
next();
|
|
|
} else {
|
|
|
// 其他无权访问的页面将重定向到登录页面
|
|
|
+ // 如果是要跳转到答题页或练习页,将临时链接存入本地,并跳转到登录页
|
|
|
+ if (['/answer', '/exercise'].includes(to.path)) setItem('temporary_link', `GCLS-Exercise/#${to.fullPath}`);
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
window.location.href = '/';
|
|
|
} else {
|