|
@@ -12,21 +12,15 @@ router.beforeEach(async (to, from, next) => {
|
|
|
NProgress.start()
|
|
|
|
|
|
const hasToken = store.getters.token
|
|
|
- let loginType = window.topU ? window.topU.U.UF.Cookie.get("cocoroboLoginType") : window.top.U.UF.Cookie.get("cocoroboLoginType");
|
|
|
- let cocorobo = window.topU ? window.topU.U.UF.Cookie.get("cocorobo") : window.top.U.UF.Cookie.get("cocorobo");
|
|
|
+ let loginType = window.topU ? window.topU.U.UF.Cookie.get("cocoroboLoginType") : window.top.U ? window.top.U.UF.Cookie.get("cocoroboLoginType") : '';
|
|
|
+ let cocorobo = window.topU ? window.topU.U.UF.Cookie.get("cocorobo") : window.top.U ? window.top.U.UF.Cookie.get("cocorobo") : '';
|
|
|
if (hasToken && cocorobo && loginType != 1) {
|
|
|
if (to.path === '/login') {
|
|
|
console.log('111111111111');
|
|
|
const userinfo = store.getters.userinfo && Object.keys(store.getters.userinfo).length > 0
|
|
|
- console.log(userinfo);
|
|
|
-
|
|
|
- if (whiteList.indexOf(to.path) !== -1) {
|
|
|
- // 在免登录白名单中,直接进入
|
|
|
- next()
|
|
|
- }else{
|
|
|
- // 如果已登录,重定向到主页
|
|
|
- next({ path: '/' })
|
|
|
- }
|
|
|
+ console.log(userinfo);
|
|
|
+ // 如果已登录,重定向到主页
|
|
|
+ next({ path: '/' })
|
|
|
NProgress.done()
|
|
|
} else {
|
|
|
const userinfo = store.getters.userinfo && Object.keys(store.getters.userinfo).length > 0
|