本地模式下无人机状态同步到云端

master
赵昌 2 weeks ago
parent b2e6820268
commit 28f7047d57

@ -15,6 +15,10 @@
*/
const WsModule = (() => {
// ---- API 地址(与 ui.js 保持一致)----
const API_BASE = (typeof window !== 'undefined' && (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1'))
? 'http://121.41.216.243' : '';
let ros = null;
let rosConnected = false;
let droneConnected = false;
@ -403,7 +407,7 @@ const WsModule = (() => {
_backendSyncCounter++;
if (_backendSyncCounter >= 25 && displayLat && displayLng) {
_backendSyncCounter = 0;
fetch('/api/drone/status', {
fetch(API_BASE + '/api/drone/status', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({

Loading…
Cancel
Save