|
@@ -55,21 +55,19 @@ router.beforeEach(async(to, from, next) => {
|
|
|
// console.log('to', {...to} )
|
|
|
if (userinfo) {
|
|
|
console.log(store)
|
|
|
- if (isWeChat === '1' || to.path === '/appStoreCopy') {
|
|
|
+ if (isWeChat === '1' || to.path === '/appStoreCopy' || to.path === '/searchL' || to.path === '/userInfoPage') {
|
|
|
next()
|
|
|
} else if (isWeChat === '2') {
|
|
|
const courseId = store.getters.courseId
|
|
|
const testId = store.getters.testId
|
|
|
const shareCourseId = store.getters.shareCourseId
|
|
|
- await store.commit('SET_TESTID', '')
|
|
|
- await store.commit('SET_COURSEID', '')
|
|
|
- await store.commit('SET_SHARECOURSEID', '')
|
|
|
if (courseId || testId || shareCourseId) {
|
|
|
- next()
|
|
|
+ Cookies.set('isWeChat', '1')
|
|
|
+ store.dispatch('user/logout')
|
|
|
+ next(`/login2?redirect=${to.path}`)
|
|
|
} else {
|
|
|
next('/appStoreCopy')
|
|
|
}
|
|
|
- Cookies.set('isWeChat', '1')
|
|
|
} else {
|
|
|
next()
|
|
|
}
|