Browse Source

重复调用的bug

刘星辰 4 months ago
parent
commit
ab1f148483
1 changed files with 7 additions and 2 deletions
  1. 7 2
      WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/LiveModule.m

+ 7 - 2
WQPlayBallLiveQiu/WQPlayBallLiveQiu/Classes/LiveModule.m

@@ -58,8 +58,13 @@ UNI_EXPORT_METHOD_SYNC(@selector(sendCommand:))
     if(options.cmd == 1000){
         //登陆
         WQCMD1000 * data = [WQCMD1000 mj_objectWithKeyValues:options.data];
-        
-//        data.accessToken = @"57ffeb3e3b4f4f80bb38b641afe7b7b0";
+    
+        ///这个方法会重复触发 重复触发不去登录
+        if([data.token isEqualToString:PBSDK.shared.accessToken] &&
+           [data.refreshToken isEqualToString:PBSDK.shared.refreshToken] &&
+           (data.expiresTime.integerValue == PBSDK.shared.expiresTime.integerValue)){
+            return;
+        }
         
         [[NSUserDefaults standardUserDefaults]setValue:data.token forKey:@"token"];
         PBSDK.shared.accessToken = data.token;