Commit 5dc9f2ae authored by 井庆林's avatar 井庆林

code review

parent 31344624
...@@ -208,6 +208,12 @@ static BOOL isGray = NO; ...@@ -208,6 +208,12 @@ static BOOL isGray = NO;
_oldPhobos.getTopController = getTopController; _oldPhobos.getTopController = getTopController;
} }
- (NSString *)serverAPI {
if (isGray) {
return _rePhobos.serverAPI;
} else _oldPhobos.serverAPI;
}
@end @end
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, PhobosDataSendStatus) { typedef NS_ENUM(NSInteger, PhobosDataSendStatus) {
PhobosDataSendStatusNormal = 0, // 普通埋点数据
PhobosDataSendStatusToBeSend = 1, // 待发送数据 PhobosDataSendStatusToBeSend = 1, // 待发送数据
PhobosDataSendStatusSending = 2, // 发送中数据 PhobosDataSendStatusSending = 2, // 发送中数据
PhobosDataSendStatusFinish = 3, // 发送完成数据 PhobosDataSendStatusFinish = 3, // 发送完成数据
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
[total addObjectsFromArray:normalDataArray]; [total addObjectsFromArray:normalDataArray];
[total addObjectsFromArray:immiDataArray]; [total addObjectsFromArray:immiDataArray];
if (total.count > 0) { if (total.count > 0) {
[self sendDataArray:total currentAPI:Phobos.sharedClient.apiHost success:^(NSInteger code) { [self sendDataArray:total currentAPI:Phobos.sharedClient.serverAPI success:^(NSInteger code) {
if (code) { if (code) {
[GMCache removeObjectAtDocumentPathWithkey:PhobosCacheKey]; [GMCache removeObjectAtDocumentPathWithkey:PhobosCacheKey];
[GMCache removeObjectAtDocumentPathWithkey:PhobosTempCacheKey]; [GMCache removeObjectAtDocumentPathWithkey:PhobosTempCacheKey];
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
+ (void)sendData:(NSData *)data success:(SendDataSuccessBlock)success { + (void)sendData:(NSData *)data success:(SendDataSuccessBlock)success {
@try { @try {
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[Phobos sharedClient].serverAPI]]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:Phobos.sharedClient.serverAPI]];
[request setValue:@"gzip" forHTTPHeaderField:@"Content-Encoding"]; [request setValue:@"gzip" forHTTPHeaderField:@"Content-Encoding"];
request.HTTPBody = data; request.HTTPBody = data;
request.HTTPMethod = @"POST"; request.HTTPMethod = @"POST";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment