Created
March 14, 2019 21:12
-
-
Save Calvin-Huang/5090bb729bc6663b06bdc3984624188e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface VIGP2API() | |
{ | |
AnGooGeneralCallbackBlock _callBack; | |
} | |
@property AnGooGeneralCallbackBlock PushMsgCallbackBlock; | |
@end | |
static TIAESCipher *_sgAesEngineObj = nil; | |
@implementation VIGP2API | |
@synthesize PushMsgCallbackBlock = _callBack; | |
+ (VIGP2API*)objectForV2AuthLoginWithTag:(NSInteger)tag | |
account:(NSString*)account | |
passwd:(NSString*)passwd | |
deviceID:(NSString*)deviceID | |
deviceCreateTime:(NSNumber*)deviceCreateTime | |
deviceType:(NSString*)deviceType | |
deviceBrand:(NSString*)deviceBrand | |
deviceOsVersion:(NSString*)deviceOsVersion | |
completion:(AnGooGeneralCallbackBlock)block | |
{ | |
NSDictionary *args = @{@"account":NotNilString(account), | |
@"password":EncryString(NotNilString(passwd)), | |
@"deviceId":NotNilString(deviceID), | |
@"deviceCreateTime":deviceCreateTime, | |
@"deviceType":NotNilString(deviceType), | |
@"deviceBrand":NotNilString(deviceBrand), | |
@"deviceOsVersion":NotNilString(deviceOsVersion)}; | |
VIGP2API *retObj = [[VIGP2API alloc]initWithArgs:args | |
tag:tag | |
trustHosts:TruckHosts | |
completion:^(id selfObj, NSInteger tag, id data, NSError *error) | |
{ | |
logExceptionWithFunc(error); | |
logf(data); | |
VIGP2API *WsApiObj = (VIGP2API*)selfObj; | |
AnGooGeneralCallbackBlock aBlock = WsApiObj.PushMsgCallbackBlock; | |
if(aBlock != nil) { | |
aBlock(selfObj, tag, data, error); | |
} | |
}]; | |
[retObj setPushMsgCallbackBlock:block]; | |
NSURLRequest *urlR = [retObj genURLRequestWithUrlString:[NSString stringWithFormat:@"%@/auth/login", GetLuxgenVIGP2Url] args:args]; | |
[retObj excuteURLRequest:urlR timeoutInSeconds:TimeoutSec]; | |
return retObj; | |
} | |
... | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment