|
@@ -117,13 +117,21 @@ router.beforeEach(async(to, from, next) => {
|
|
|
// in the free login whitelist, go directly
|
|
|
next()
|
|
|
} else {
|
|
|
+ const courseId = store.getters.courseId
|
|
|
+ const testId = store.getters.testId
|
|
|
+ const shareCourseId = store.getters.shareCourseId
|
|
|
+
|
|
|
// 检查是否是微信授权回调
|
|
|
- if (window.location.href.indexOf('login') !== -1 && window.location.href.indexOf('login2') === -1) {
|
|
|
+ if (courseId || testId || shareCourseId) {
|
|
|
+ next(`/login2?redirect=${to.path}`)
|
|
|
+ NProgress.done()
|
|
|
+ } else if (window.location.href.indexOf('login') !== -1 && window.location.href.indexOf('login2') === -1) {
|
|
|
// 微信授权回调,允许访问
|
|
|
next('/login')
|
|
|
+ NProgress.done()
|
|
|
} else {
|
|
|
// // other pages that do not have permission to access are redirected to the login page.
|
|
|
- next(`/login?redirect=${to.path}`)
|
|
|
+ next(`/login2?redirect=${to.path}`)
|
|
|
NProgress.done()
|
|
|
}
|
|
|
}
|