|
@@ -54,12 +54,21 @@ router.beforeEach(async(to, from, next) => {
|
|
|
console.log('userinfo', userinfo)
|
|
|
// console.log('to', {...to} )
|
|
|
if (userinfo) {
|
|
|
- debugger
|
|
|
console.log(store)
|
|
|
if (isWeChat === '1' || to.path === '/appStoreCopy') {
|
|
|
next()
|
|
|
} else if (isWeChat === '2') {
|
|
|
- next('/appStoreCopy')
|
|
|
+ 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()
|
|
|
+ } else {
|
|
|
+ next('/appStoreCopy')
|
|
|
+ }
|
|
|
} else {
|
|
|
next()
|
|
|
}
|