| | |
| | | // [self handleTheError:error]; |
| | | // }]; |
| | | |
| | | [EZHttpUtil addDeviceByHDL:[GlobalKit shareKit].deviceSerialNo |
| | | [EZHttpUtil.sharedManager addDeviceByHDL:[GlobalKit shareKit].deviceSerialNo |
| | | verifyCode:[GlobalKit shareKit].deviceVerifyCode |
| | | completion:^(ResponseData *responseData) { |
| | | [hud hide:YES]; |
| | |
| | | // [hud hide:YES]; |
| | | // [self handleTheError:error]; |
| | | // }]; |
| | | [EZHttpUtil addDeviceByHDL:[GlobalKit shareKit].deviceSerialNo |
| | | verifyCode:[GlobalKit shareKit].deviceVerifyCode |
| | | completion:^(ResponseData *responseData) { |
| | | [hud hide:YES]; |
| | | [self handleTheError:responseData]; |
| | | }]; |
| | | |
| | | if ([GlobalKit shareKit].deviceType==HDLEZDeviceType_Door) {//为门禁设备(需要验证门锁) |
| | | [EZHttpUtil.sharedManager verifyLocalLockByHDL:[GlobalKit shareKit].deviceSerialNo completion:^(ResponseData * _Nonnull responseData) { |
| | | [hud hide:YES]; |
| | | if (responseData.success) { |
| | | self.resultLabel.numberOfLines=2; |
| | | self.resultLabel.adjustsFontSizeToFitWidth=YES; |
| | | self.resultLabel.text = NSLocalizedString(@"ad_result_verify_local_lock",@"请在2分钟之内校验已添加的主用户指纹、密钥或感应卡,校验完成请点击已校验按钮"); |
| | | |
| | | [self.actionButton setTitle:NSLocalizedString(@"ad_verified", @"已校验") forState:UIControlStateNormal]; |
| | | }else{ |
| | | [self handleTheError:responseData]; |
| | | } |
| | | |
| | | NSLog(@"调用验证接口返回:%@",responseData.data); |
| | | }]; |
| | | }else{ |
| | | [EZHttpUtil.sharedManager addDeviceByHDL:[GlobalKit shareKit].deviceSerialNo |
| | | verifyCode:[GlobalKit shareKit].deviceVerifyCode |
| | | completion:^(ResponseData *responseData) { |
| | | [hud hide:YES]; |
| | | [self handleTheError:responseData]; |
| | | }]; |
| | | } |
| | | |
| | | } |
| | | else |
| | |
| | | [alertView show]; |
| | | } |
| | | } |
| | | else if([self.actionButton.titleLabel.text isEqualToString:NSLocalizedString(@"ad_verified",@"已校验")]) |
| | | { |
| | | __weak MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; |
| | | hud.labelText = NSLocalizedString(@"ad_adding_msg", @"正在添加,请稍候..."); |
| | | [EZHttpUtil.sharedManager addDeviceByHDL:[GlobalKit shareKit].deviceSerialNo |
| | | verifyCode:[GlobalKit shareKit].deviceVerifyCode |
| | | completion:^(ResponseData *responseData) { |
| | | [hud hide:YES]; |
| | | if (!responseData.success){ |
| | | [self.view makeToast:NSLocalizedString(@"wifi_add_fail", @"添加失败") duration:2.0 position:@"center"]; |
| | | }else{ |
| | | [self handleTheError:responseData]; |
| | | } |
| | | |
| | | }]; |
| | | } |
| | | else |
| | | { |
| | | [self doSearchDevice]; |