App.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <router-view />
  3. </template>
  4. <script setup lang="ts">
  5. import Speech from 'speak-tts';
  6. import http from '@/api';
  7. const { proxy } = getCurrentInstance() as any;
  8. let speech = new Speech();
  9. if (speech.hasBrowserSupport()) {
  10. proxy?.$modal.msgWarning(`不支持TTS`);
  11. http?.common.baiduToken({}).then((res: any) => {
  12. let tok = res.token;
  13. localStorage.setItem('tok', tok);
  14. });
  15. }
  16. // import { useWebSocket } from '@/utils/handWs';
  17. // const { handWs, startDevice, startHand, stateHand } = useWebSocket();
  18. // const router = useRouter();
  19. // const data = reactive<any>({
  20. // deviceInfo: {},//设备信息
  21. // });
  22. // const { deviceInfo } = toRefs(data);
  23. // /**
  24. // * 手势
  25. // */
  26. // const getHandWs = async () => {
  27. // //加载手势WS
  28. // handWs((e: any) => {
  29. // // console.log("eeee", e)
  30. // if (e?.wksid) {
  31. // //获取设备项目
  32. // let deviceid = localStorage.getItem("deviceid") || '';
  33. // if (deviceid) {
  34. // startDevice({ deviceid: deviceid })
  35. // }
  36. // }
  37. // //接收设备信息
  38. // if (e?.device_info) {
  39. // deviceInfo.value = e.device_info;
  40. // let handcontroller_id = deviceInfo.value.handcontroller_id;
  41. // stateHand(handcontroller_id);
  42. // }
  43. // //获取手势状态
  44. // if (e?.cmd == 'get_handcontroller_state' && e?.state == 0) {
  45. // let handcontroller_id = deviceInfo.value.handcontroller_id;
  46. // startHand(handcontroller_id);
  47. // }
  48. // //刷新
  49. // if (e?.data?.result == "refresh") {
  50. // router.push({ path: '/gesture' });
  51. // //刷新
  52. // window.location.reload()
  53. // }
  54. // });
  55. // };
  56. // getHandWs()
  57. </script>
  58. <style scoped></style>