parent
33787eadf1
commit
c8b0df3774
43 changed files with 58 additions and 65 deletions
@ -1,13 +1,14 @@ |
||||
import router from "./index"; |
||||
import Setting from "@/setting"; |
||||
import util from "@/libs/util"; |
||||
import store from '@/store' |
||||
|
||||
const whiteList = Setting.whiteList // 白名单
|
||||
router.beforeEach((to, from, next) => { |
||||
document.title = Setting.titleSuffix; |
||||
const role = util.local.get(Setting.tokenKey); |
||||
document.title = Setting.titleSuffix |
||||
const role = util.session.get(Setting.tokenKey) |
||||
if (!role && !whiteList.includes(to.path)) { |
||||
next('/login') |
||||
store.dispatch('user/logout') |
||||
} else { |
||||
next() |
||||
} |
||||
|
Loading…
Reference in new issue