siyouyou 5 달 전
부모
커밋
242e29c53c
2개의 변경된 파일23개의 추가작업 그리고 19개의 파일을 삭제
  1. 17 17
      src/utils/request.js
  2. 6 2
      src/views/streamRadio/index.vue

+ 17 - 17
src/utils/request.js

@@ -50,23 +50,23 @@ function tryHideFullScreenLoading() {
 
 // request interceptor
 service.interceptors.request.use(
-    (config) => {
-        if (window.location.hash !== "#/dashboard") {
-            showFullScreenLoading();
-        }
-        const token = localStorage.getItem("token");
-        token && (config.headers.Authorization = token);
-        // token && (config.headers.token = token);
-        return config;
-    },
-    (error) => {
-        if (window.location.hash !== "#/dashboard") {
-            tryHideFullScreenLoading();
-        }
-        // do something with request error
-        console.log(error); // for debug
-        return Promise.reject(error);
+  (config) => {
+    if (window.location.hash !== "#/dashboard"&&window.location.hash !=='#/streamRadio/index') {
+      showFullScreenLoading();
+    }
+    const token = localStorage.getItem("token");
+    token && (config.headers.Authorization = token);
+    // token && (config.headers.token = token);
+    return config;
+  },
+  (error) => {
+    if (window.location.hash !== "#/dashboard") {
+      tryHideFullScreenLoading();
     }
+    // do something with request error
+    console.log(error); // for debug
+    return Promise.reject(error);
+  }
 );
 
 // response interceptor
@@ -170,4 +170,4 @@ service.interceptors.response.use(
     }
 );
 
-export default service;
+export default service;

+ 6 - 2
src/views/streamRadio/index.vue

@@ -67,11 +67,15 @@ export default {
   name: 'streamRadio',
   data() {
     return {
-      tableData: []
+      tableData: [],
+      timer:null
     }
   },
   created() {
-    this.getData()
+    this.timer=setInterval(this.getData,2000)
+  },
+  beforeDestroy() {
+    clearInterval(this.timer)
   },
   methods: {
     hoursUntil(targetTime) {