1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <template>
- <router-view />
- </template>
- <script setup lang="ts">
- //import Speech from 'speak-tts';
- const { proxy } = getCurrentInstance() as any;
- 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()) {
- // 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();
- // const router = useRouter();
- // const data = reactive<any>({
- // deviceInfo: {},//设备信息
- // });
- // const { deviceInfo } = toRefs(data);
- // /**
- // * 手势
- // */
- // const getHandWs = async () => {
- // //加载手势WS
- // handWs((e: any) => {
- // // console.log("eeee", e)
- // if (e?.wksid) {
- // //获取设备项目
- // let deviceid = localStorage.getItem("deviceid") || '';
- // if (deviceid) {
- // startDevice({ deviceid: deviceid })
- // }
- // }
- // //接收设备信息
- // if (e?.device_info) {
- // deviceInfo.value = e.device_info;
- // let handcontroller_id = deviceInfo.value.handcontroller_id;
- // stateHand(handcontroller_id);
- // }
- // //获取手势状态
- // if (e?.cmd == 'get_handcontroller_state' && e?.state == 0) {
- // let handcontroller_id = deviceInfo.value.handcontroller_id;
- // startHand(handcontroller_id);
- // }
- // //刷新
- // if (e?.data?.result == "refresh") {
- // router.push({ path: '/gesture' });
- // //刷新
- // window.location.reload()
- // }
- // });
- // };
- // getHandWs()
- </script>
- <style scoped></style>
|