瀏覽代碼

集成用户权限

natasha 8 月之前
父節點
當前提交
619e44aa2c
共有 3 個文件被更改,包括 25 次插入10 次删除
  1. 11 1
      src/components/Header.vue
  2. 9 5
      src/views/learn-center/Seekresult.vue
  3. 5 4
      src/views/learn-center/index.vue

+ 11 - 1
src/components/Header.vue

@@ -212,6 +212,7 @@ export default {
       removeToken()
       removeSession('SysList')
       Cookies.remove('JSESSIONID')
+      Cookies.remove('GCLSCode')
       this.userShow = false
       this.userMessage = null
     },
@@ -253,7 +254,16 @@ export default {
       getContent(MethodName, {})
         .then((res) => {
           if (res.child_sys_list && res.child_sys_list.length > 0) {
-            _this.projectList = res.child_sys_list
+            if (Cookies.get('GCLSCode')) {
+              _this.projectList = []
+              res.child_sys_list.forEach((item) => {
+                if (item.key === 'GCLS-LC' || item.key === 'GCLS-Personal') {
+                  _this.projectList.push(item)
+                }
+              })
+            } else {
+              _this.projectList = res.child_sys_list
+            }
             _this.projectList.forEach((item, index) => {
               if (item.key == 'GCLS-LC') {
                 _this.LoginNavIndex = index

+ 9 - 5
src/views/learn-center/Seekresult.vue

@@ -14,7 +14,7 @@
     </div> -->
     <div class="main">
       <!-- 搜索结果分类 -->
-      <div class="classilfy">
+      <div class="classilfy" v-if="!hasGCLSCode">
         <div
           v-for="(item, i) in classilfyList"
           :key="i + item"
@@ -83,6 +83,7 @@ import ClassicalCourse from '@/components/learnCenter/ClassicalCourse'
 import Course from '@/components/learnCenter/Course'
 import Textbook from '@/components/learnCenter/Textbook'
 import { updateWordPack } from '@/utils/i18n'
+import Cookies from 'js-cookie'
 export default {
   props: [],
   components: {
@@ -105,12 +106,13 @@ export default {
       targetPage: 1,
       loading: false,
       classilfyList: [],
-      classilfyIndex: 0,
+      classilfyIndex: Cookies.get('GCLSCode') ? 1 : 0,
       classilfyID: null,
       isData: false,
       pageSizes: [8, 16, 32, 64],
       pageSizes1: [8, 16, 32, 64],
       pageSizes2: [10, 20, 30, 40],
+      hasGCLSCode: Cookies.get('GCLSCode'),
     }
   },
   computed: {
@@ -232,8 +234,8 @@ export default {
     this.classilfyID = this.$route.query.id
     // classilfyIndex
     // if (this.$route.query.id == "COURSE") {
-    this.classilfyIndex = 0
-    this.getData('课程')
+    this.classilfyIndex = Cookies.get('GCLSCode') ? 1 : 0
+    this.getData(Cookies.get('GCLSCode') ? '教材' : '课程')
     // } else {
     //   this.getData("教材");
     //   this.classilfyIndex = 1;
@@ -252,7 +254,9 @@ export default {
       ],
     })
     this.isData = true
-    this.classilfyList = [this.$t('Key215'), this.$t('Key44')]
+    this.classilfyList = Cookies.get('GCLSCode')
+      ? [this.$t('Key44')]
+      : [this.$t('Key215'), this.$t('Key44')]
   },
 }
 </script>

+ 5 - 4
src/views/learn-center/index.vue

@@ -12,7 +12,7 @@
           text-color="#000"
           active-text-color="#FF9900"
         >
-          <el-menu-item index="COURSE"
+          <el-menu-item index="COURSE" v-if="!hasGCLSCode"
             ><!-- 课程 -->{{ $t('Key215') }}</el-menu-item
           >
           <el-menu-item index="TEXTBOOK">{{ $t('Key44') }}</el-menu-item>
@@ -48,7 +48,7 @@
         </el-carousel>
       </div> -->
       <div class="ClassifyList" v-if="isData">
-        <div id="COURSE">
+        <div id="COURSE" v-if="!hasGCLSCode">
           <Course :classList="courseList" />
         </div>
         <div id="TEXTBOOK">
@@ -94,8 +94,8 @@ export default {
     return {
       isData: false,
       seekContent: '', //搜索内容
-      activeIndex: 'COURSE', //默认展示精品课程
-      navName: 'COURSE',
+      activeIndex: Cookies.get('GCLSCode') ? 'TEXTBOOK' : 'COURSE', //默认展示精品课程
+      navName: Cookies.get('GCLSCode') ? 'TEXTBOOK' : 'COURSE',
       buy: false,
       classList: [],
       disSeekShow: false,
@@ -122,6 +122,7 @@ export default {
       TextbookList: null, //教材列表
       LearnResourceList: null, //学习资源
       SeekName: '',
+      hasGCLSCode: Cookies.get('GCLSCode'),
     }
   },
   computed: {