1.优化网络访问失败的时间为6s

2.网关锁和wifi锁判断优化
This commit is contained in:
sky.min 2025-12-25 11:21:41 +08:00
parent 0267f58a27
commit ed09754406
2 changed files with 26 additions and 26 deletions

View File

@ -707,34 +707,34 @@ class LockDetailLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) {
showToast('已开锁'.tr);
}
}
} else {
// WiFi锁
final LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo;
final network = currentKeyInfo.network;
if (network != null && (network.peerId != null && network.peerId != '' && network.peerId!.isNotEmpty)){
final network = currentKeyInfo.network;
var lockPeerId = '';
if (network != null && network.peerId != null && network.peerId!.isNotEmpty) {
lockPeerId = network.peerId!;
StartChartManage().lockPeerId = lockPeerId;
}
// WiFi锁
final LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo;
final network = currentKeyInfo.network;
if (network != null && (network.peerId != null && network.peerId!.isNotEmpty)){
final network = currentKeyInfo.network;
var lockPeerId = '';
if (network != null && network.peerId != null && network.peerId!.isNotEmpty) {
lockPeerId = network.peerId!;
StartChartManage().lockPeerId = lockPeerId;
}
if (lockPeerId.isEmpty) {
AppLog.log('远程服务未连接,无法进行远程开锁');
return;
}
if (lockPeerId.isEmpty) {
AppLog.log('远程服务未连接,无法进行远程开锁');
return;
final response = await StartChartApi.to.analyzeInformationOtherEnd(peerId: lockPeerId);
if (response.statusCode == 200) {
AppLog.log('成功分析对端信息');
} else {
AppLog.log('分析对端信息失败,状态码: ${response.statusCode}');
return;
}
//
await _sendUnlockViaBluetooth();
}
}
final response = await StartChartApi.to.analyzeInformationOtherEnd(peerId: lockPeerId);
if (response.statusCode == 200) {
AppLog.log('成功分析对端信息');
} else {
AppLog.log('分析对端信息失败,状态码: ${response.statusCode}');
return;
}
//
await _sendUnlockViaBluetooth();
}
}
//

View File

@ -61,7 +61,7 @@ class BaseProvider extends GetConnect with Api {
if (res.body == null) {
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
if (res.statusCode == null && isShowErrMsg!) {
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr, duration: 2000.milliseconds);
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr, duration: 6000.milliseconds);
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
}
var rs = {'errorMsg': 'Network Error!', 'errorCode': -1, 'data': null, 'description': '表示成功或是。'};