重构和优化http接口支持切换端口

This commit is contained in:
2026-09-18 09:43:32 +08:00
parent ab75e8c5b0
commit fb2f32f423
8 changed files with 32 additions and 21 deletions

View File

@@ -34,7 +34,7 @@ class DeviceHttpDatasourceImpl implements DeviceHttpDatasource {
logger.logWithLevel(
'用户点击bindDevice方法API 请求开始',
level: 'INFO',
data: {'url': 'http://1.95.137.212:8081/iot/device/bindDevice'},
data: {'url': '${HttpApiConsts.baseUrl}/iot/device/bindDevice'},
);
var response = await dio.post(
HttpApiConsts.bindDevice,
@@ -44,7 +44,7 @@ class DeviceHttpDatasourceImpl implements DeviceHttpDatasource {
'请求详细参数',
level: 'DEBUG',
data: {
'url': 'http://1.95.137.212:8081/iot/device/bindDevice',
'url': '${HttpApiConsts.baseUrl}/iot/device/bindDevice',
'deviceId': deviceId,
'deviceAlias': deviceAlias,
},
@@ -122,7 +122,7 @@ class DeviceHttpDatasourceImpl implements DeviceHttpDatasource {
logger.logWithLevel(
'用户点击switchDevice方法API 请求开始',
level: 'INFO',
data: {'url': 'http://1.95.137.212:8081/iot/device/switchDevice'},
data: {'url': '${HttpApiConsts.baseUrl}/iot/device/switchDevice'},
);
var response = await dio.post(
HttpApiConsts.switchDevice,
@@ -138,7 +138,7 @@ class DeviceHttpDatasourceImpl implements DeviceHttpDatasource {
'请求详细参数',
level: 'DEBUG',
data: {
'url': 'http://1.95.137.212:8081/iot/device/switchDevice',
'url': '${HttpApiConsts.baseUrl}/iot/device/switchDevice',
'platform': platform,
'deviceId': deviceId,
},
@@ -219,12 +219,12 @@ class DeviceHttpDatasourceImpl implements DeviceHttpDatasource {
'请求详细参数',
level: 'DEBUG',
data: {
'url': 'http://1.95.137.212:8081/iot/device/userDevice',
'url': '${HttpApiConsts.baseUrl}/iot/device/userDevice',
'tenantName': deviceame,
},
);
final response = await dio.get(
'http://1.95.137.212:8081/iot/device/userDevice',
HttpApiConsts.getDeviceLocation,
queryParameters: {'tenantName': deviceame},
// options: Options(
// headers: {