|
@@ -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();
|