|
@@ -127,8 +127,11 @@ router.beforeEach(async (to, from, next) => {
|
|
|
// 在免登录名单,直接进入
|
|
|
next()
|
|
|
} else {
|
|
|
- window.location.href = `https://dev.autocde.com/login?redirect=${to.fullPath}`;
|
|
|
- // next({ path: loginRoutePath, query: { redirect: to.fullPath } })
|
|
|
+ if(window.location.href.startsWith("http://localhost")){
|
|
|
+ next({ path: '/user/login' })
|
|
|
+ }else{
|
|
|
+ window.location.href = `https://dev.autocde.com/login?redirect=${to.fullPath}`;
|
|
|
+ }
|
|
|
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
|
|
|
}
|
|
|
}
|