From f0094b618efb1ec60df47b90e1b6cf70e35978a3 Mon Sep 17 00:00:00 2001 From: CherrysChang <1935003650@qq.com> Date: Thu, 16 Apr 2020 10:46:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=A1=88=E4=BE=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=96=B0=E5=A2=9E=E5=88=9D=E5=A7=8B=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 3 +- src/views/train/case-detail.vue | 82 +++++++++++++++++++++------------ 2 files changed, 53 insertions(+), 32 deletions(-) diff --git a/src/main.js b/src/main.js index c65b413..683a5c0 100644 --- a/src/main.js +++ b/src/main.js @@ -46,10 +46,9 @@ const router = new VueRouter({ router.beforeEach((to, from, next) => { //NProgress.start(); - // debugger; let user = JSON.parse(sessionStorage.getItem('user')); if (!user && to.path != '/login') { - if(to.path == '/train'){//暂时这么写,user是需要有值的,这里先方便页面 + if(/train/.test(to.path)){//暂时这么写,user是需要有值的,这里先方便页面 next() }else{ next({ path: '/login' }) diff --git a/src/views/train/case-detail.vue b/src/views/train/case-detail.vue index 5535c51..9bd470c 100644 --- a/src/views/train/case-detail.vue +++ b/src/views/train/case-detail.vue @@ -1,26 +1,20 @@