Steven пре 7 месеци
родитељ
комит
61cf45d89c

+ 0 - 22
KulexiuForStudent/KulexiuForStudent/Common/Base/AccompanyWebView/KSAccompanyWebViewController.m

@@ -258,28 +258,6 @@
     [self configAudioSession];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appEnterBackground) name:@"appEnterBackground" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appEnterForeground) name:@"appEnterForeground" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(otherLogin) name:@"otherLogin" object:nil];
-}
-
-- (void)otherLogin {
-    // 停止播放和录制
-    [self stopSession];
-    [self stopPlayAction];
-    [self stopRecordService];
-    [self stopTuner];
-    
-    if (_AQManager) {
-        [_AQManager freeAudioQueue];
-    }
-    // 如果退出评测页面 清除 playerEngine
-    if (self.playerEngine) {
-        [self.playerEngine cleanup];
-        self.playerEngine = nil;
-    }
-    // 返回不保存视频
-    [self ignorRecordVideo];
-    [self freeMp3Player];
-    [self removeTuner];
 }
 
 

+ 22 - 31
KulexiuForStudent/KulexiuForStudent/Common/Base/LoginManger/KSLoginManager.m

@@ -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]]) {