林旭祥 1 mese fa
parent
commit
82c5a1903d
1 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. 11 0
      src/App.vue

+ 11 - 0
src/App.vue

@@ -3,6 +3,17 @@
 </template>
 
 <script setup lang="ts">
+import Speech from 'speak-tts';
+import http from '@/api';
+const { proxy } = getCurrentInstance() as any;
+let speech = new Speech();
+if (speech.hasBrowserSupport()) {
+    proxy?.$modal.msgWarning(`不支持TTS`);
+    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();