token null validate

pull/1/head
pnoker 6 years ago
parent 2aa23c3be5
commit 0cd8744e4e

@ -32,7 +32,12 @@ router.beforeEach((to, from, next) => {
if (meta.isAuth !== true) { if (meta.isAuth !== true) {
next(); next();
} else { } else {
checkTokenValid(getToken()).then(res => { const token = getToken();
if ('' === token || undefined === token) {
next({path: '/login'});
return;
}
checkTokenValid(token).then(res => {
if (res.ok && store.getters.token.length > 0) { if (res.ok && store.getters.token.length > 0) {
next(); next();
} else { } else {

Loading…
Cancel
Save