林旭祥 1 month ago
parent
commit
66fa9a14a8
1 changed files with 7 additions and 5 deletions
  1. 7 5
      src/App.vue

+ 7 - 5
src/App.vue

@@ -4,12 +4,14 @@
 
 <script setup lang="ts">
 //import Speech from 'speak-tts';
+import router from '@/router';
 const { proxy } = getCurrentInstance() as any;
-proxy?.$http.common.baiduToken({}).then((res: any) => {
-    let tok = res.token;
-    localStorage.setItem('tok', tok);
-});
-
+if (!['/analysis/index', '/analysis/detail'].includes(router.currentRoute.value.path)) {
+    proxy?.$http.common.baiduToken({}).then((res: any) => {
+        let tok = res.token;
+        localStorage.setItem('tok', tok);
+    });
+}
 //let speech = new Speech();
 //let state = localStorage.getItem('ttsState');
 // if (!speech.hasBrowserSupport()) {