Steven 11 ماه پیش
والد
کامیت
b30c729900

+ 0 - 21
KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/KSAccompanyWebViewController.m

@@ -256,29 +256,8 @@
     [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];
-}
 
 - (void)checkMessage:(id)message {
     NSDictionary *result = [message mj_JSONObject];

+ 21 - 27
KulexiuForTeacher/KulexiuForTeacher/Common/Base/LoginManger/KSLoginManager.m

@@ -85,36 +85,13 @@
         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];
-                }
+                [ctrl popToRootViewControllerAnimated:YES];
+                [self performSelector:@selector(resetToLoginViewController:) withObject:tab afterDelay:0.1];
             }];
         }
         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];
-            }
+            [ctrl popToRootViewControllerAnimated:YES];
+            [self performSelector:@selector(resetToLoginViewController:) withObject:tab afterDelay:0.1];
         }
     }
     else if ([vc isKindOfClass:NSClassFromString(@"CustomNavViewController")]) {
@@ -132,6 +109,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]]) {

+ 4 - 4
KulexiuForTeacher/KulexiuForTeacher/Common/Base/LoginManger/TXIMLinsenter.m

@@ -121,11 +121,11 @@
 - (void)onKickedOffline {
     // 被踢下线
     NSLog(@"----- 被踢下线");
-#ifdef DEBUG
-
-#else
+//#ifdef DEBUG
+//
+//#else
     [[NSNotificationCenter defaultCenter] postNotificationName:@"otherLogin" object:nil];
-#endif
+//#endif
 }
 
 - (void)onUserSigExpired {