|
|
|
@ -2,7 +2,6 @@ import Vue from 'vue' |
|
|
|
import Router from 'vue-router' |
|
|
|
import http from '@/utils/request' |
|
|
|
import { isURL } from '@/utils/validate' |
|
|
|
import Cookies from 'js-cookie' |
|
|
|
|
|
|
|
Vue.use(Router) |
|
|
|
|
|
|
|
@ -47,10 +46,6 @@ const router = new Router({ |
|
|
|
}) |
|
|
|
|
|
|
|
router.beforeEach((to, from, next) => { |
|
|
|
var token = Cookies.get('token') |
|
|
|
if (to.path === '/login' && token !== undefined && token !== null && token !== '') { |
|
|
|
return next({ name: 'home' }) |
|
|
|
} |
|
|
|
// 添加动态(菜单)路由
|
|
|
|
// 已添加或者当前路由为页面路由, 可直接访问
|
|
|
|
if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) { |
|
|
|
|