lsc 3 days ago
parent
commit
df7efbb980
4 changed files with 7 additions and 6 deletions
  1. 0 0
      dist/index.html
  2. 1 1
      dist/report.html
  3. 0 0
      dist/static/js/app.69d1e2b1.js
  4. 6 5
      src/permission.js

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 1 - 1
dist/report.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.69d1e2b1.js


+ 6 - 5
src/permission.js

@@ -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',

Some files were not shown because too many files changed in this diff