From d4a6aa1cb207d8179e93ff654e005f55207704df Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 18 Mar 2021 15:01:13 +0800 Subject: [PATCH] =?UTF-8?q?demo=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 18 +- src/views/demo/index.vue | 308 ++++++++++++------ .../components/menus/gernaratePlanTrain.vue | 1 - 3 files changed, 222 insertions(+), 105 deletions(-) diff --git a/src/permission.js b/src/permission.js index cbe99cd26..45d906e97 100644 --- a/src/permission.js +++ b/src/permission.js @@ -7,7 +7,7 @@ import 'nprogress/nprogress.css'; import { setToken, getToken, removeToken, getSessionStorage } from '@/utils/auth'; import localStore from 'storejs'; -const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool']; // 不重定向白名单 +const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo']; // 不重定向白名单 for (const val in loginInfo) { if (loginInfo[val].loginPath && !whiteList.includes(loginInfo[val].loginPath)) { @@ -67,15 +67,15 @@ router.beforeEach((to, from, next) => { document.title = loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title; NProgress.start(); const loginPath = getRouteInfo(to); - const token = to.query.token + const token = to.query.token; - if (/demoTraining/.test(to.path) && token) { - const header = { group: to.query.group, 'X-Token': token }; - setToken(token); - store.commit('SET_TOKEN', token) - store.commit('SUBSCRIBE', { header, type: '' }); - next(); - } else if (getToken()) { + if (/demoTraining/.test(to.path) && token) { + const header = { group: to.query.group, 'X-Token': token }; + setToken(token); + store.commit('SET_TOKEN', token); + store.commit('SUBSCRIBE', { header, type: '' }); + next(); + } else if (getToken()) { if (to.path === loginPath) { // 登录页面不拦截 next(); diff --git a/src/views/demo/index.vue b/src/views/demo/index.vue index d387508d3..da4bccc16 100644 --- a/src/views/demo/index.vue +++ b/src/views/demo/index.vue @@ -3,6 +3,8 @@
教学系统
+
登录
+
{{ nickName }}
@@ -26,21 +28,67 @@
+ + + + + + + + + + + + + + + + + + +
{{ tipsMsg }}
+ + + {{ $t('login.login') }} + + +
+