| | |
| | | |
| | | // const ROBOTAXI_HOST = '"http://192.168.110.80:8000"'; // 打车接口域名 |
| | | // const ROBOTAXI_WS_HOST = '"ws://192.168.110.34:8888/websocket"'; |
| | | const ROBOTAXI_HOST = '"http://221.182.45.100:8000"'; |
| | | const ROBOTAXI_WS_HOST = '"ws://221.182.45.100:8888/websocket"'; |
| | | // const ROBOTAXI_HOST = '"https://rt-api.deploy-test.xiaopeng.com"'; |
| | | // const ROBOTAXI_WS_HOST = '"wss://rt-api.deploy-test.xiaopeng.com/websocket"'; |
| | | // const ROBOTAXI_HOST = '"http://221.182.45.100:8000"'; |
| | | // const ROBOTAXI_WS_HOST = '"ws://221.182.45.100:8888/websocket"'; |
| | | const ROBOTAXI_HOST = '"https://rt-api.deploy-test.xiaopeng.com"'; |
| | | const ROBOTAXI_WS_HOST = '"wss://rt-api.deploy-test.xiaopeng.com/websocket"'; |
| | | |
| | | const XP_APPID_MAP = { |
| | | weapp: '"xp_cs_wom"', |
| | |
| | | |
| | | // 获取uid |
| | | const uid = await getStorage(_UID) || '-1'; |
| | | header['XP-Uid'] = '20260227200715' || uid.toString(); |
| | | header['XP-Uid'] = uid.toString(); |
| | | |
| | | // 获取设备id |
| | | header['XP-Deviceid'] = Taro.getStorageSync('wxOpenId') || 'default_device_id'; |
| | |
| | | const uid = await getStorage(_UID) || '-1'; |
| | | const task = Taro.connectSocket({ |
| | | header: { |
| | | 'XP-Uid': '20260227200715' || uid.toString(), |
| | | 'XP-Uid': uid.toString(), |
| | | }, |
| | | url: this.url, |
| | | success: () => { }, |
| | |
| | | this.reconnectAttempts = 0; |
| | | this.startHeartbeat(); |
| | | const uid = await getStorage(_UID) || '-1'; |
| | | this.send({ type: 'auth', appUserId: '20260227200715', timestamp: Date.now() }); |
| | | this.send({ type: 'auth', appUserId: uid.toString(), timestamp: Date.now() }); |
| | | this.notifyListeners('open', { status: 'connected' }); |
| | | }); |
| | | |
| | |
| | | this.reconnectAttempts = 0; |
| | | this.startHeartbeat(); |
| | | const uid = await getStorage(_UID) || '-1'; |
| | | this.send({ type: 'auth', appUserId: '20260227200715', timestamp: Date.now() }); |
| | | this.send({ type: 'auth', appUserId: uid.toString(), timestamp: Date.now() }); |
| | | this.notifyListeners('open', { status: 'connected' }); |
| | | }); |
| | | |