|
|
@@ -42,6 +42,9 @@
|
|
|
@property(nonatomic, assign) bool isNeedToShowSecretKey;//扫码进来的SN 没有密码 则需要显示秘钥
|
|
|
|
|
|
@property (nonatomic, assign) BOOL isLoginAgainType;// 单点登录 点重新登录进来的
|
|
|
+
|
|
|
+@property (nonatomic, assign) BOOL isNeedToStopWork;// 无网络报错
|
|
|
+@property (nonatomic, assign) BOOL isDidShowPwdType;// 是否显示密码界面了
|
|
|
@end
|
|
|
|
|
|
@implementation SceneDelegate
|
|
|
@@ -96,6 +99,10 @@
|
|
|
// self.window.rootViewController = qrCodeVCNav;
|
|
|
// return;/*临时测试*/
|
|
|
|
|
|
+ if(_isNeedToStopWork){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
/*先判断本地有无设备 无设备时需要先扫码添加设备*/
|
|
|
NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
|
|
|
if (!deviceDict || ![[deviceDict allKeys] containsObject:Const_Have_Add_Device_SN]){
|
|
|
@@ -137,6 +144,7 @@
|
|
|
}
|
|
|
|
|
|
[self getDeviceMsgInMainVCWith:deviceDict];
|
|
|
+ //[self showNetErrorAlertType2Fun];
|
|
|
}
|
|
|
|
|
|
- (void)getDeviceMsgInMainVCWith:(NSDictionary*)deviceDict
|
|
|
@@ -152,10 +160,14 @@
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
mainBlock(^{
|
|
|
[weakSelf showNetErrorAlertFun];
|
|
|
+ [weakSelf enterMainVCFromSceneSecondStepFun];
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
- [weakSelf enterMainVCFromSceneSecondStepFun];
|
|
|
+ else{
|
|
|
+ [weakSelf enterMainVCFromSceneSecondStepFun];
|
|
|
+ }
|
|
|
+
|
|
|
}];
|
|
|
}
|
|
|
else{
|
|
|
@@ -526,7 +538,7 @@
|
|
|
[self closeCalculatorVC];
|
|
|
_inputVC = [[inputPWDViewController alloc] init];
|
|
|
[self.window addSubview:_inputVC.view];
|
|
|
-
|
|
|
+ _isDidShowPwdType = YES;
|
|
|
}
|
|
|
else if (maskModel == 2){
|
|
|
/*浏览器*/
|
|
|
@@ -535,12 +547,14 @@
|
|
|
_webVC.pwd = PwdStr;
|
|
|
_webVC.webUrl = @"https://baidu.com";
|
|
|
[self.window addSubview:_webVC.view];
|
|
|
+ _isDidShowPwdType = YES;
|
|
|
}else{
|
|
|
/*计算器*/
|
|
|
[self closeCalculatorVC];
|
|
|
_calculatorVC = [[CalculatorViewController alloc] init];
|
|
|
_calculatorVC.pwd = PwdStr;
|
|
|
[self.window addSubview:_calculatorVC.view];
|
|
|
+ _isDidShowPwdType = YES;
|
|
|
}
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:ShowPwdVCNotification object:nil];
|
|
|
@@ -559,6 +573,7 @@
|
|
|
if(_inputVC){
|
|
|
[_inputVC.view removeFromSuperview];
|
|
|
}
|
|
|
+ _isDidShowPwdType = NO;
|
|
|
}
|
|
|
|
|
|
- (NSString *)documentPathForAccount:(NSString *)account fileFolder:(NSString *)fileFolder {
|
|
|
@@ -744,13 +759,16 @@
|
|
|
{
|
|
|
NSInteger maskModel = [HWDataManager getIntegerWithKey:Const_Mask_View_Model];
|
|
|
|
|
|
- if(maskModel !=0){
|
|
|
+ if(maskModel !=0 && _isDidShowPwdType){
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
NSString *linkErrTip = NSLocalizedString(@"player_link_fail_couldPhone_Tips",nil);
|
|
|
if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable){
|
|
|
linkErrTip = NSLocalizedString(@"player_link_fail_phone_Tips",nil);
|
|
|
+ _isNeedToStopWork = YES;
|
|
|
+ [self showNetErrorAlertType2Fun];
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
linkErrTip = [[NSString alloc] initWithFormat:@"[9]%@",linkErrTip];
|
|
|
@@ -774,4 +792,34 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
+#pragma mark 网络异常弹框
|
|
|
+-(void)showNetErrorAlertType2Fun
|
|
|
+{
|
|
|
+
|
|
|
+ if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable){
|
|
|
+
|
|
|
+ NSString * linkErrTip = NSLocalizedString(@"netWork_error_tip_content",nil);
|
|
|
+
|
|
|
+ ComontAlretViewController *linkFailAlretVC= [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"netWork_error_tip_title",nil)
|
|
|
+ msg:linkErrTip
|
|
|
+ imageStr:nil
|
|
|
+ cancelTitle:NSLocalizedString(@"single_sign_on_exit",nil)
|
|
|
+ okTitle:nil isOkBtnHighlight:NO
|
|
|
+ didClickOk:^{
|
|
|
+
|
|
|
+ //[self enterMainVCFromScene];
|
|
|
+ } didClickCancel:^{
|
|
|
+ exit(0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ linkFailAlretVC.modalPresentationStyle = UIModalPresentationCustom;
|
|
|
+
|
|
|
+ self.window.rootViewController = [UIViewController new];
|
|
|
+ [self.window.rootViewController presentViewController:linkFailAlretVC animated:YES completion:^{
|
|
|
+ linkFailAlretVC.view.superview.backgroundColor = [UIColor clearColor];
|
|
|
+ }];
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
@end
|