1:修复远程遥控控制状态显示不正确的问题

2:更换端口映射为测试服的8081-59003,9001-59004
This commit is contained in:
2026-08-26 14:23:20 +08:00
parent ca616faf11
commit 7c01229b9e
22 changed files with 399 additions and 119 deletions

View File

@@ -1,7 +1,8 @@
class HttpApiConsts {
// static const String baseUrl = "http://8.159.134.0:8012"; // 旧地址
// static const String baseUrl = "http://1.95.137.212:59015"; // 测试地址
static const String baseUrl = "http://1.95.137.212:8081"; // 生产地址
// static const String baseUrl = "http://1.95.137.212:8081"; // 生产地址(暂时切到测试服 59003,回退时恢复此行)
static const String baseUrl = "http://1.95.137.212:59003"; // 测试服地址
/// 账号相关
// 登录
@@ -65,7 +66,7 @@ class HttpApiConsts {
static const String flightTaskCommand = "$baseUrl/iot/UAV/flightTaskCommand";
/// 告警相关
static const String alarmBaseUrl = "http://1.95.137.212:8081";
static const String alarmBaseUrl = baseUrl;
// 获取告警工单配置列表
static const String alarmOrderConfigList =
"$alarmBaseUrl/iot/alarmOrderConfig/list";
@@ -104,6 +105,10 @@ class HttpApiConsts {
// 设备操作权限校验
static const String hasPermission = "$baseUrl/iot/device/hasPermission";
// 释放远程控制权限(请求体:platform/type/deviceId/token)
static const String releaseControlUrl =
"$baseUrl/forward/device/releaseControl";
/// 用户相关
// 获取用户列表
static const String systemUserList = "$baseUrl/system/user/list";

View File

@@ -18,10 +18,10 @@ class EnvConfig {
static String get tcpIp => '1.95.137.212';
static int get tcpPort {
// 测试服: 59016, 生产服: 9001
// 测试服: 59016, 生产服: 9001(目前暂时都走测试服 59004,回退时改回 9001)
if (environment == 'prod') {
return 9001;
return 59004;
}
return 9001; // TCP 端口
return 59004; // TCP 端口
}
}

View File

@@ -0,0 +1,24 @@
import 'package:maibu_satabot_v2/core/consts/http_api_consts.dart';
/// 图片地址工具:后端返回的图片路径可能是相对路径(如 /profile/avatar/xxx.jpg),
/// 直接交给 Image.network 会因缺少 host 抛 "No host specified in URI" 异常。
/// 此工具负责将相对路径拼接成完整的服务器地址。
class ImageUrlUtil {
ImageUrlUtil._();
/// 补全图片地址
/// - 已是完整 http(s) 地址:原样返回
/// - 以 / 开头的相对路径:拼接 baseUrl
/// - 其他相对路径:拼接 baseUrl + /
/// - null 或空:返回 null
static String? resolve(String? path) {
if (path == null || path.isEmpty) return null;
if (path.startsWith('http://') || path.startsWith('https://')) {
return path;
}
if (path.startsWith('/')) {
return '${HttpApiConsts.baseUrl}$path';
}
return '${HttpApiConsts.baseUrl}/$path';
}
}