1.优化网络访问失败的时间为6s
2.网关锁和wifi锁判断优化
This commit is contained in:
parent
0267f58a27
commit
ed09754406
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
// 通过蓝牙透传发送开锁命令
|
||||
|
||||
@ -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': '表示成功或是。'};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user