Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. @interface VIGP2API()
  2. {
  3. AnGooGeneralCallbackBlock _callBack;
  4. }
  5.  
  6. @property AnGooGeneralCallbackBlock PushMsgCallbackBlock;
  7. @end
  8.  
  9. static TIAESCipher *_sgAesEngineObj = nil;
  10. @implementation VIGP2API
  11.  
  12. @synthesize PushMsgCallbackBlock = _callBack;
  13.  
  14. + (VIGP2API*)objectForV2AuthLoginWithTag:(NSInteger)tag
  15. account:(NSString*)account
  16. passwd:(NSString*)passwd
  17. deviceID:(NSString*)deviceID
  18. deviceCreateTime:(NSNumber*)deviceCreateTime
  19. deviceType:(NSString*)deviceType
  20. deviceBrand:(NSString*)deviceBrand
  21. deviceOsVersion:(NSString*)deviceOsVersion
  22. completion:(AnGooGeneralCallbackBlock)block
  23. {
  24. NSDictionary *args = @{@"account":NotNilString(account),
  25. @"password":EncryString(NotNilString(passwd)),
  26. @"deviceId":NotNilString(deviceID),
  27. @"deviceCreateTime":deviceCreateTime,
  28. @"deviceType":NotNilString(deviceType),
  29. @"deviceBrand":NotNilString(deviceBrand),
  30. @"deviceOsVersion":NotNilString(deviceOsVersion)};
  31.  
  32. VIGP2API *retObj = [[VIGP2API alloc]initWithArgs:args
  33. tag:tag
  34. trustHosts:TruckHosts
  35. completion:^(id selfObj, NSInteger tag, id data, NSError *error)
  36. {
  37. logExceptionWithFunc(error);
  38. logf(data);
  39. VIGP2API *WsApiObj = (VIGP2API*)selfObj;
  40. AnGooGeneralCallbackBlock aBlock = WsApiObj.PushMsgCallbackBlock;
  41.  
  42. if(aBlock != nil) {
  43. aBlock(selfObj, tag, data, error);
  44. }
  45. }];
  46.  
  47. [retObj setPushMsgCallbackBlock:block];
  48. NSURLRequest *urlR = [retObj genURLRequestWithUrlString:[NSString stringWithFormat:@"%@/auth/login", GetLuxgenVIGP2Url] args:args];
  49.  
  50. [retObj excuteURLRequest:urlR timeoutInSeconds:TimeoutSec];
  51.  
  52. return retObj;
  53. }
  54.  
  55. ...
  56.  
  57. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement