natasha 1 rok temu
rodzic
commit
2ee2af0b20
2 zmienionych plików z 5 dodań i 4 usunięć
  1. 4 3
      src/App.vue
  2. 1 1
      src/views/teacher-dev/index.vue

+ 4 - 3
src/App.vue

@@ -13,7 +13,7 @@
 </template>
 </template>
 <script>
 <script>
 import { removeSession } from '@/utils/role';
 import { removeSession } from '@/utils/role';
-import { removeToken } from '@/utils/auth';
+import { removeToken, getToken } from '@/utils/auth';
 import Cookies from 'js-cookie';
 import Cookies from 'js-cookie';
 import { getConfig } from '@/utils/auth';
 import { getConfig } from '@/utils/auth';
 export default {
 export default {
@@ -64,7 +64,8 @@ export default {
     isTimeOut() {
     isTimeOut() {
       clearInterval(this.timeOut);
       clearInterval(this.timeOut);
       let dataConfig = getConfig() ? JSON.parse(getConfig()) : null;
       let dataConfig = getConfig() ? JSON.parse(getConfig()) : null;
-      if (dataConfig && dataConfig.user_connection_timeout_duration) {
+      let dataToken = getToken() ? JSON.parse(getToken()) : null;
+      if (dataConfig && dataConfig.user_connection_timeout_duration && dataToken) {
         this.timeOut = setInterval(() => {
         this.timeOut = setInterval(() => {
           let lastClickTime = sessionStorage.getItem('lastClickTime') * 1;
           let lastClickTime = sessionStorage.getItem('lastClickTime') * 1;
           let nowTime = new Date().getTime();
           let nowTime = new Date().getTime();
@@ -84,7 +85,7 @@ export default {
   },
   },
   mounted() {
   mounted() {
     sessionStorage.setItem('lastClickTime', new Date().getTime());
     sessionStorage.setItem('lastClickTime', new Date().getTime());
-    this.isTimeOut();
+    // this.isTimeOut();
   },
   },
 };
 };
 </script>
 </script>

+ 1 - 1
src/views/teacher-dev/index.vue

@@ -87,7 +87,7 @@ export default {
   },
   },
   computed: {},
   computed: {},
   async created() {
   async created() {
-    console.log('2024.01.12');
+    console.log('2024.01.12-1');
     // 如果是edu.blcup.com环境下就隐藏文本分析入口
     // 如果是edu.blcup.com环境下就隐藏文本分析入口
     if (document.domain === 'edu.blcup.com') {
     if (document.domain === 'edu.blcup.com') {
       this.textAnalyseShow = false;
       this.textAnalyseShow = false;