|
@@ -3,7 +3,7 @@ import store from './store'
|
|
|
import { Message } from 'element-ui'
|
|
import { Message } from 'element-ui'
|
|
|
import NProgress from 'nprogress'
|
|
import NProgress from 'nprogress'
|
|
|
import 'nprogress/nprogress.css'
|
|
import 'nprogress/nprogress.css'
|
|
|
-import { getToken } from '@/utils/auth'
|
|
|
|
|
|
|
+import { getToken, removeToken } from '@/utils/auth'
|
|
|
|
|
|
|
|
NProgress.configure({ showSpinner: false })
|
|
NProgress.configure({ showSpinner: false })
|
|
|
|
|
|
|
@@ -15,6 +15,7 @@ router.beforeEach((to, from, next) => {
|
|
|
if (getToken()) {
|
|
if (getToken()) {
|
|
|
/* has token*/
|
|
/* has token*/
|
|
|
if (to.path === '/login') {
|
|
if (to.path === '/login') {
|
|
|
|
|
+ removeToken()
|
|
|
next({ path: '/' })
|
|
next({ path: '/' })
|
|
|
NProgress.done()
|
|
NProgress.done()
|
|
|
} else if (to.path == '/certification'){
|
|
} else if (to.path == '/certification'){
|