mo 4 лет назад
Родитель
Сommit
8ca3405767

+ 10 - 1
src/store/modules/permission.js

@@ -597,9 +597,18 @@ const actions = {
   generateRoutes({ commit }) {
     return new Promise(resolve => {
       // 获取接口返回的权限菜单
-      getSilder().then(res => {
+      getSilder().then(async res => {
         if (res.code == 200) {
           let result = addTopMenu(res.data)
+          if(res.data?.length <1){
+            // 一条权限都没有
+            //退出 跳到登录页 提示'该账号无任何权限'
+            await this.$store.dispatch("user/logout");
+            localStorage.removeItem("firstMenuUrl");
+            // await this.$store.dispatch("permission/removePermission")
+            this.$router.push(`/login`);
+            window.location.reload();
+          }
           let newData = recursionRouter(result);
 
           newData = getFirstMenu(newData)

+ 2 - 2
src/views/indexErrDataRecord/components/errorCourse.vue

@@ -645,8 +645,8 @@ export default {
     },
     lookDetail(row) {
       this.$router.push({
-        path: "/teamCourseList",
-        query: { courseIdSearch: row.id },
+       name:'teamCourseList',
+       params:{courseIdSearch: row.id}
       });
       // this.maskForm = row;
       // 发请求 获取详情 row.id

+ 17 - 6
src/views/teamDetail/teamCourseList.vue

@@ -864,6 +864,7 @@ const initSearch = {
   courseIdSearch: null,
 };
 export default {
+  name:'teamCourseList',
   data() {
     return {
       classVisible: false,
@@ -934,9 +935,10 @@ export default {
     },
   },
   mounted() {
-    const { query } = this.$route;
-    if(query.courseIdSearch){
-      this.searchForm.courseIdSearch = query.courseIdSearch
+    const { query ,params} = this.$route;
+    if(params.courseIdSearch){
+
+      this.searchForm.courseIdSearch = params.courseIdSearch
     }
     if (query.start || query.end) {
       this.searchForm.timer = [query.start, query.end];
@@ -955,7 +957,6 @@ export default {
           }
         }
       }
-       console.log('flag',flag,this.searchForm.timer)
       if (!flag) {
         this.searchForm.timer = [nowTime, nowTime];
       }
@@ -984,7 +985,9 @@ export default {
         this.searchForm.timer = [query.start, query.end];
       } else {
         this.searchForm.timer = [];
+        this.reset()
       }
+
     },
     permission(str, parent) {
       return permission(str, parent);
@@ -1036,12 +1039,15 @@ export default {
     },
     reset() {
       this.searchForm = { ...initSearch };
+      // this.$router.push({ query: {} })
       this.search();
     },
     search() {
       this.rules.page = 1;
-      this.$refs.searchForm.save(this.searchForm);
+
+
       this.getList();
+
     },
     common(row) {
       this.searchForm = {
@@ -1167,10 +1173,13 @@ export default {
             });
             this.isDetele = false;
           });
-
+           this.$refs.searchForm.save(this.searchForm);
+            //
+        //  this.$router.push({ query: {} })
           // let arr = this.$helpers.lodash.differenceWith( this.tableList, this.deleteList,'id')
         }
       });
+      //  this.$router.replace({ query: {...this.$route.query,courseIdSearch:null} })
     },
     lookDetail(row) {
       // this.maskForm = row;
@@ -1375,6 +1384,8 @@ export default {
         this.activeName = null;
       }
     },
+    'searchForm.courseIdSearch'(val){
+    }
   },
 };
 </script>