|
@@ -77,6 +77,29 @@ router.beforeEach(async (to, from, next) => {
|
|
window.location.href = backurl + '?backurl=' + backurl + '&admintoken=' + getToken()
|
|
window.location.href = backurl + '?backurl=' + backurl + '&admintoken=' + getToken()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(loginType == null){
|
|
|
|
+ const userInfo = await getInfo();
|
|
|
|
+
|
|
|
|
+ if(userInfo.code == 400){
|
|
|
|
+ console.log("用户没有访问权限,将跳转到无权限页面!")
|
|
|
|
+ if (to.path !== '/no-permission') {
|
|
|
|
+
|
|
|
|
+ removeToken()
|
|
|
|
+
|
|
|
|
+ next({path:'/no-permission'})
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ next()
|
|
|
|
+ }
|
|
|
|
+ NProgress.done()
|
|
|
|
+ }else{
|
|
|
|
+ setUseType(userInfo.data.type_id, 86400)
|
|
|
|
+ setWebSiteId(userInfo.data.website_id, 86400)
|
|
|
|
+ console.log("用户有访问权限,访问继续!")
|
|
|
|
+ next()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
|
|
|
|
const hasRoles = store.getters.roles && store.getters.roles.length > 0
|
|
const hasRoles = store.getters.roles && store.getters.roles.length > 0
|