|
@@ -82,45 +82,19 @@
|
|
|
// 返回登录页面
|
|
|
UIViewController *vc = [UIApplication sharedApplication].keyWindow.rootViewController;
|
|
|
if ([vc isKindOfClass:[UITabBarController class]]) {
|
|
|
- UITabBarController *tab = (UITabBarController *)vc;
|
|
|
+ UITabBarController *tab = (UITabBarController *)[UIApplication sharedApplication].keyWindow.rootViewController;
|
|
|
CustomNavViewController *ctrl = (CustomNavViewController *)tab.selectedViewController;
|
|
|
if (ctrl.presentedViewController) {
|
|
|
UIViewController *presentCtrl = ctrl.presentedViewController;
|
|
|
[presentCtrl dismissViewControllerAnimated:YES completion:^{
|
|
|
- LoginViewController *logonVC = [[LoginViewController alloc] init];
|
|
|
- CustomNavViewController *navCtrl = [[CustomNavViewController alloc] initWithRootViewController:logonVC];
|
|
|
- [AppDelegate shareAppDelegate].window.rootViewController = navCtrl;
|
|
|
-
|
|
|
- // 切换到横屏
|
|
|
- AppDelegate* delegate = [AppDelegate shareAppDelegate];
|
|
|
- if (delegate.allowAutoRotate) {
|
|
|
- delegate.allowAutoRotate = NO;
|
|
|
- if (IS_IPAD) {
|
|
|
- logonVC.zh_statusBarHidden = NO;
|
|
|
- }
|
|
|
- [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait inController:logonVC];
|
|
|
- }
|
|
|
- [delegate refreshThemeColorAndConfig];
|
|
|
+ [ctrl popToRootViewControllerAnimated:YES];
|
|
|
+ [self resetToLoginViewController:tab];
|
|
|
}];
|
|
|
}
|
|
|
else {
|
|
|
- [ctrl popToRootViewControllerAnimated:NO];
|
|
|
- LoginViewController *logonVC = [[LoginViewController alloc] init];
|
|
|
- CustomNavViewController *navCtrl = [[CustomNavViewController alloc] initWithRootViewController:logonVC];
|
|
|
- [AppDelegate shareAppDelegate].window.rootViewController = navCtrl;
|
|
|
-
|
|
|
- // 切换到横屏
|
|
|
- AppDelegate* delegate = [AppDelegate shareAppDelegate];
|
|
|
- if (delegate.allowAutoRotate) {
|
|
|
- delegate.allowAutoRotate = NO;
|
|
|
- if (IS_IPAD) {
|
|
|
- logonVC.zh_statusBarHidden = NO;
|
|
|
- }
|
|
|
- [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait inController:logonVC];
|
|
|
- }
|
|
|
- [delegate refreshThemeColorAndConfig];
|
|
|
+ [ctrl popToRootViewControllerAnimated:YES];
|
|
|
+ [self resetToLoginViewController:tab];
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
else if ([vc isKindOfClass:NSClassFromString(@"CustomNavViewController")]) {
|
|
|
// dismiss
|
|
@@ -138,6 +112,23 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+- (void)resetToLoginViewController:(UITabBarController *)tab {
|
|
|
+ LoginViewController *logonVC = [[LoginViewController alloc] init];
|
|
|
+ CustomNavViewController *navCtrl = [[CustomNavViewController alloc] initWithRootViewController:logonVC];
|
|
|
+ navCtrl.modalPresentationStyle = UIModalPresentationFullScreen;
|
|
|
+ [tab.selectedViewController presentViewController:navCtrl animated:YES completion:nil];
|
|
|
+
|
|
|
+ // 切换到横屏
|
|
|
+ AppDelegate* delegate = [AppDelegate shareAppDelegate];
|
|
|
+ if (delegate.allowAutoRotate) {
|
|
|
+ delegate.allowAutoRotate = NO;
|
|
|
+ if (IS_IPAD) {
|
|
|
+ logonVC.zh_statusBarHidden = NO;
|
|
|
+ }
|
|
|
+ [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait inController:logonVC];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
- (NSString *)getVisableControllerName {
|
|
|
UIViewController *vc = [AppDelegate shareAppDelegate].window.rootViewController;
|
|
|
if ([vc isKindOfClass:[UITabBarController class]]) {
|