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,12 +707,11 @@ class LockDetailLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('已开锁'.tr); showToast('已开锁'.tr);
} }
} } else {
// WiFi锁 // WiFi锁
final LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo; final LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo;
final network = currentKeyInfo.network; final network = currentKeyInfo.network;
if (network != null && (network.peerId != null && network.peerId!.isNotEmpty)){ if (network != null && (network.peerId != null && network.peerId != '' && network.peerId!.isNotEmpty)){
final network = currentKeyInfo.network; final network = currentKeyInfo.network;
var lockPeerId = ''; var lockPeerId = '';
if (network != null && network.peerId != null && network.peerId!.isNotEmpty) { if (network != null && network.peerId != null && network.peerId!.isNotEmpty) {
@ -736,6 +735,7 @@ class LockDetailLogic extends BaseGetXController {
await _sendUnlockViaBluetooth(); await _sendUnlockViaBluetooth();
} }
} }
}
// //
Future<void> _sendUnlockViaBluetooth() async { Future<void> _sendUnlockViaBluetooth() async {

View File

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