diff --git a/src/views/index.vue b/src/views/index.vue index 5cd2e7b..a5657ad 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1168,6 +1168,8 @@ import { getLocalPositionRelativeToP4, parseTime } from '@/utils/tool' +// import {ScreenOrientation} from '@capacitor/screen-orientation'; +// import { StatusBar, Style } from '@capacitor/status-bar'; const formUrl = 'http://192.168.1.123:5000/' const router = useRouter() @@ -1354,10 +1356,10 @@ const getSocket = () => { const socket = import.meta.env.MODE === 'development' ? new WebSocket("ws://192.168.1.123:7789/ws") : new WebSocket("wss://www.scrin.xyz/ws"); socket.addEventListener("open", () => { - console.log("✅ WebSocket 连接成功"); - setInterval(() => { - socket.send('ping') - }, 1000) + // console.log("✅ WebSocket 连接成功"); + // setInterval(() => { + // socket.send('ping') + // }, 1000) }); socket.addEventListener("message", (event) => { @@ -2571,6 +2573,27 @@ onMounted(() => { getShildTableList() getObstacleList() // testFun() + +// +// function lockLandscapeIfSmallWidth() { +// const w = window.innerWidth; +// +// if (w < 700) { +// // 锁定横屏 +// ScreenOrientation.lock({orientation: 'landscape'}); +// StatusBar.hide(); +// } else { +// // 允许自由旋转 +// ScreenOrientation.unlock(); +// StatusBar.show(); +// StatusBar.setStyle({ style: Style.Default }); +// } +// } +// +// // 初始化执行一次 +// lockLandscapeIfSmallWidth(); + + }) const testFun = () => { let areaData111 = [ diff --git a/vite.config.js b/vite.config.js index 3ea2435..2eaef43 100644 --- a/vite.config.js +++ b/vite.config.js @@ -9,7 +9,9 @@ export default defineConfig({ host: '0.0.0.0', port: 5173, open: true, proxy: { '/dev-api': { // target: 'http://192.168.1.123:5000', - target: 'http://192.168.0.103:5000', + // target: 'http://192.168.0.105:5000', + // target: 'http://192.168.0.13:5000', + target: 'http://192.168.1.123:5000', changeOrigin: true, ws: true, secure: false,