fix permission bug

This commit is contained in:
Pan
2017-05-11 16:52:38 +08:00
parent cab7d44771
commit b8068a4896
3 changed files with 8 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ router.beforeEach((to, from, next) => {
if (to.path === '/login') {
next({ path: '/' });
} else {
if (to.meta && to.meta.role) {
if (to.meta && to.meta.role && store.getters.uid) {
if (hasPermission(store.getters.roles, to.meta.role)) {
next();
} else {