fix cookie token bug

This commit is contained in:
Pan
2017-07-20 13:26:09 +08:00
parent c8856741c6
commit a0a011e985
4 changed files with 26 additions and 10 deletions

View File

@@ -19,6 +19,7 @@ import IconSvg from 'components/Icon-svg';// svg 组件
import vueWaves from './directive/waves';// 水波纹指令
import errLog from 'store/errLog';// error log组件
import './mock/index.js'; // 该项目所有请求使用mockjs模拟
import { getToken } from 'utils/auth';
// register globally
Vue.component('multiselect', Multiselect);
@@ -43,7 +44,7 @@ function hasPermission(roles, permissionRoles) {
const whiteList = ['/login', '/authredirect', '/reset', '/sendpwd'];// 不重定向白名单
router.beforeEach((to, from, next) => {
NProgress.start(); // 开启Progress
if (store.getters.token) { // 判断是否有token
if (getToken()) { // 判断是否有token
if (to.path === '/login') {
next({ path: '/' });
} else {