lsc 3 days ago
parent
commit
1d5d6271c6
4 changed files with 21 additions and 2 deletions
  1. 0 0
      dist/index.html
  2. 1 1
      dist/report.html
  3. 0 0
      dist/static/js/app.4bdf2739.js
  4. 20 1
      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.4bdf2739.js


+ 20 - 1
src/permission.js

@@ -75,7 +75,26 @@ router.beforeEach(async(to, from, next) => {
       console.log('userinfo', userinfo)
       // console.log('to', {...to} )
       if (userinfo) {
-        next()
+        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) {
+          next({ ...to, query: { courseid: courseId, userid: hasToken }, replace: true })
+        } else if (testId) {
+          next({ ...to, query: { courseid: testId, userid: hasToken }, replace: true })
+        } else if (shareCourseId) {
+          next({
+            path: '/courseDetail',
+            query: { courseid: shareCourseId, urlType: 1, userid: hasToken },
+            replace: true
+          })
+        } else {
+          next()
+        }
       } else {
         try {
           // 获取用户信息

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