|
|
@@ -129,7 +129,7 @@ router.beforeEach((to, from, next) => {
|
|
|
}).then((res) => {
|
|
|
// 处理返回数据
|
|
|
console.log("统一授权套件SDK==res=", res);
|
|
|
- authLogin({ code: res.result.authCode, corpId: corpId })
|
|
|
+ authLogin({ code: res.result.authCode, corpId: corpId.corpId })
|
|
|
.then((res) => {
|
|
|
debugger
|
|
|
console.log("===登录授权=", res);
|
|
|
@@ -144,15 +144,17 @@ router.beforeEach((to, from, next) => {
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
+ }else{
|
|
|
+ if (whiteList.indexOf(to.path) !== -1) {
|
|
|
+ // 在免登录白名单,直接进入
|
|
|
+ next()
|
|
|
+ } else {
|
|
|
+ const redirect = encodeURIComponent(to.fullPath) // 编码 URI,保证参数跳转回去后,可以继续带上
|
|
|
+ next(`/login?redirect=${redirect}`) // 否则全部重定向到登录页
|
|
|
+ NProgress.done()
|
|
|
+ }
|
|
|
}
|
|
|
- // if (whiteList.indexOf(to.path) !== -1) {
|
|
|
- // // 在免登录白名单,直接进入
|
|
|
- // next()
|
|
|
- // } else {
|
|
|
- // const redirect = encodeURIComponent(to.fullPath) // 编码 URI,保证参数跳转回去后,可以继续带上
|
|
|
- // next(`/login?redirect=${redirect}`) // 否则全部重定向到登录页
|
|
|
- // NProgress.done()
|
|
|
- // }
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
|