Steven 6 months ago
parent
commit
dad269378b

+ 5 - 1
KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m

@@ -64,10 +64,14 @@
     // Do any additional setup after loading the view.
     [self allocTitle:@"课程详情"];
     [self configUI];
-    [self requestCourseInfoMessage];
     self.isModify = NO;
 }
 
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    [self requestCourseInfoMessage];
+}
+
 - (void)requestCourseInfoMessage {
     [self requestHomeworkMessage];
     [self requestEvaluateMessage];

+ 5 - 1
KulexiuForStudent/KulexiuForStudent/Module/Course/MusicRoom/Controller/MusicRoomDetailViewController.m

@@ -60,10 +60,14 @@
     // Do any additional setup after loading the view.
     [self allocTitle:@"课程详情"];
     [self configUI];
-    [self requestCourseInfoMessage];
     self.isModify = NO;
 }
 
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    [self requestCourseInfoMessage];
+}
+
 - (void)requestCourseInfoMessage {
     [self requestHomeworkMessage];
     [self requestRoomConfig];

+ 3 - 13
KulexiuForStudent/KulexiuForStudent/Module/TXClassRoom/Controller/TXClassroomViewController.m

@@ -240,7 +240,6 @@
     [self joinChatRoom];
     self.view.backgroundColor = HexRGB(0xffffff);
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leaveRoomAction) name:@"classroomLogout" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(quitRoomAction) name:@"classroomQuit" object:nil];
         
     [self addSubviews];
     [self bindDelegates];
@@ -267,25 +266,16 @@
 #pragma mark ----- 账号异地登陆
 - (void)leaveRoomAction {
     [LOADING_MANAGER MBShowAUTOHidingInWindow:@"该账号在其他设备上登录"];
-    self.isQuitRoom = YES;
-    [[LoginHelper sharedInstance] logout];
-    self.cancleAlert = YES;
-    [TRTC_MANAGER leaveRoom:^(NSInteger code) {
-        
-    }];
-    [[NSNotificationCenter defaultCenter] postNotificationName:@"backLoginView" object:nil];
-}
-
-
-- (void)quitRoomAction {
+    @weakObj(self);
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        @strongObj(self);
         self.isQuitRoom = YES;
         [[LoginHelper sharedInstance] logout];
         self.cancleAlert = YES;
         [TRTC_MANAGER leaveRoom:^(NSInteger code) {
             
         }];
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"showOtherLoginAlert" object:nil];
+        [self hideAlertView];
     });
 }
 

+ 1 - 9
KulexiuForStudent/KulexiuForStudent/Module/TXLive/Controller/TXLiveRoomViewController.m

@@ -333,9 +333,7 @@ static int clickPraiseBtnTimes  = 0;
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMessageNotification:) name:OnReceiveTXLiveMessageNotification object:nil];
     
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(liveroomLogOut) name:@"liveroomLogout" object:nil];
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(liveroomQuit) name:@"liveroomQuit" object:nil];
-    
+        
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(IMConnetedCallback) name:@"TXIMConnected" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(muteAllAudio) name:@"muteLiveAudio" object:nil];
     
@@ -403,12 +401,6 @@ static int clickPraiseBtnTimes  = 0;
     });
 }
 
-- (void)liveroomQuit {
-    [self quitRoom];
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"backLoginView" object:nil];
-    });
-}
 - (void)muteAllAudio {
     [self muteVoiceAction];
 }