|
@@ -8,20 +8,23 @@ const { proxy } = getCurrentInstance() as any;
|
|
let speech = new Speech();
|
|
let speech = new Speech();
|
|
let state = localStorage.getItem('ttsState');
|
|
let state = localStorage.getItem('ttsState');
|
|
if (!speech.hasBrowserSupport()) {
|
|
if (!speech.hasBrowserSupport()) {
|
|
- proxy?.$modal.msgWarning(`不支持TTS`);
|
|
|
|
- if (state != "1") {
|
|
|
|
|
|
+ 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) => {
|
|
proxy?.$http.common.baiduToken({}).then((res: any) => {
|
|
let tok = res.token;
|
|
let tok = res.token;
|
|
localStorage.setItem('tok', tok);
|
|
localStorage.setItem('tok', tok);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-if (state == "1") {
|
|
|
|
- proxy?.$http.common.baiduToken({}).then((res: any) => {
|
|
|
|
- let tok = res.token;
|
|
|
|
- localStorage.setItem('tok', tok);
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
// import { useWebSocket } from '@/utils/handWs';
|
|
// import { useWebSocket } from '@/utils/handWs';
|
|
// const { handWs, startDevice, startHand, stateHand } = useWebSocket();
|
|
// const { handWs, startDevice, startHand, stateHand } = useWebSocket();
|
|
|
|
|