Browse Source

日常开发

林旭祥 4 weeks ago
parent
commit
0cf2d4143f
1 changed files with 19 additions and 14 deletions
  1. 19 14
      src/App.vue

+ 19 - 14
src/App.vue

@@ -3,27 +3,32 @@
 </template>
 
 <script setup lang="ts">
-import Speech from 'speak-tts';
+//import Speech from 'speak-tts';
 const { proxy } = getCurrentInstance() as any;
-let speech = new Speech();
+//let speech = new Speech();
 let state = localStorage.getItem('ttsState');
-if (!speech.hasBrowserSupport()) {
-    proxy?.$modal.msgWarning(`不支持系统TTS,已切换百度TTS`);
-    localStorage.setItem('ttsState', "1");
+if (state == "1") {
     proxy?.$http.common.baiduToken({}).then((res: any) => {
         let tok = res.token;
         localStorage.setItem('tok', tok);
     });
-
-} else {
-    // 如果支持,但是选择了使用百度TTS那就要获取新token
-    if (state == "1") {
-        proxy?.$http.common.baiduToken({}).then((res: any) => {
-            let tok = res.token;
-            localStorage.setItem('tok', tok);
-        });
-    }
 }
+// if (!speech.hasBrowserSupport()) {
+//     proxy?.$modal.msgWarning(`不支持系统TTS,已切换百度TTS`);
+//     localStorage.setItem('ttsState', "1");
+//     proxy?.$http.common.baiduToken({}).then((res: any) => {
+//         let tok = res.token;
+//         localStorage.setItem('tok', tok);
+//     });
+// } else {
+//     // 如果支持,但是选择了使用百度TTS那就要获取新token
+//     if (state == "1") {
+//         proxy?.$http.common.baiduToken({}).then((res: any) => {
+//             let tok = res.token;
+//             localStorage.setItem('tok', tok);
+//         });
+//     }
+// }
 
 // import { useWebSocket } from '@/utils/handWs';
 // const { handWs, startDevice, startHand, stateHand } = useWebSocket();