Ver Fonte

配置教研工具权限

natasha há 1 ano atrás
pai
commit
e573e4a0f0
1 ficheiros alterados com 23 adições e 6 exclusões
  1. 23 6
      src/components/teacher-dev/TeachingTool.vue

+ 23 - 6
src/components/teacher-dev/TeachingTool.vue

@@ -1,13 +1,20 @@
 <template>
   <!-- 教研工具 -->
-  <div class="Textbook">
+  <div
+    class="Textbook"
+    v-if="
+      popedom_code_list.indexOf(2100001) > -1 ||
+      popedom_code_list.indexOf(2100002) > -1 ||
+      popedom_code_list.indexOf(2100003) > -1
+    "
+  >
     <div class="top">
       <div class="title">
         <span class="text"> 教研工具</span>
       </div>
     </div>
     <div class="class_list">
-      <div>
+      <div v-if="popedom_code_list.indexOf(2100001) > -1">
         <div
           style="background: #4ca6ee"
           @click="
@@ -20,7 +27,7 @@
         </div>
         <p>文本分析</p>
       </div>
-      <div>
+      <div v-if="popedom_code_list.indexOf(2100002) > -1">
         <div
           style="background: #d86046"
           @click="
@@ -33,7 +40,7 @@
         </div>
         <p>教材语料库</p>
       </div>
-      <div>
+      <div v-if="popedom_code_list.indexOf(2100003) > -1">
         <div
           style="background: #c254cc"
           @click="
@@ -64,12 +71,22 @@
 </template>
 
 <script>
+import { getToken } from '@/utils/auth';
 export default {
   props: ['classList', 'type'],
   data() {
-    return {};
+    return {
+      popedom_code_list: [],
+    };
+  },
+  created() {
+    let userInfor = getToken()
+      ? JSON.parse(getToken())
+      : sessionStorage.getItem('GCLS_Token_Tc')
+      ? JSON.parse(sessionStorage.getItem('GCLS_Token_Tc'))
+      : null;
+    this.popedom_code_list = userInfor ? userInfor.popedom_code_list : [];
   },
-  created() {},
   methods: {},
 };
 </script>