|
@@ -75,17 +75,18 @@ router.beforeEach(async(to, from, next) => {
|
|
|
console.log('userinfo', userinfo)
|
|
|
// console.log('to', {...to} )
|
|
|
if (userinfo) {
|
|
|
- const courseId = store.getters.courseId
|
|
|
- const testId = store.getters.testId
|
|
|
- const shareCourseId = store.getters.shareCourseId
|
|
|
+ const courseId = to.query.courseid
|
|
|
+ const testId = to.query.testid
|
|
|
+ const shareCourseId = to.query.shareCourseId
|
|
|
await store.commit('SET_TESTID', '')
|
|
|
await store.commit('SET_COURSEID', '')
|
|
|
await store.commit('SET_SHARECOURSEID', '')
|
|
|
+
|
|
|
// // 根据角色生成可访问的路线图
|
|
|
if (courseId) {
|
|
|
- next({ ...to, query: { courseid: courseId, userid: hasToken }, replace: true })
|
|
|
+ next({ path: '/courseDetail', query: { courseid: courseId, userid: hasToken }, replace: true })
|
|
|
} else if (testId) {
|
|
|
- next({ ...to, query: { courseid: testId, userid: hasToken }, replace: true })
|
|
|
+ next({ path: '/testDetail', query: { courseid: testId, userid: hasToken }, replace: true })
|
|
|
} else if (shareCourseId) {
|
|
|
next({
|
|
|
path: '/courseDetail',
|