Commit 015f2ae1 authored by 汪洋's avatar 汪洋

将上传url配置外露

parent 4472a7d0
......@@ -18,9 +18,19 @@
- (void)viewDidLoad
{
[super viewDidLoad];
#ifdef POD_CONFIGURATION_APP_STORE
NSString *url = @"http://log.gmei.com/log/collect";
#elif POD_CONFIGURATION_UNIT_TEST
NSString *url = @"http://jaguar.gmei/log/collect";
#else
NSString *url = @"http://log.test.gengmei.cc/log/collect";
#endif
[Phobos sharedClient].serverAPI = url;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
......
......@@ -76,6 +76,10 @@
*/
@property (strong, nonatomic) NSMutableDictionary *userType;
/**
数据接收的服务器API
*/
@property (copy, nonatomic) NSString *serverAPI;
#pragma mark - 事件采集
/**
......
......@@ -13,6 +13,7 @@
#import <ifaddrs.h>
#import <arpa/inet.h>
#import <net/if.h>
#import "Phobos.h"
#define IOS_CELLULAR @"pdp_ip0"
#define IOS_WIFI @"en0"
......@@ -105,15 +106,8 @@
}
+ (void)sendData:(NSData *)data success:(SendDataSuccessBlock)success {
#ifdef POD_CONFIGURATION_APP_STORE
NSString *url = @"http://log.gmei.com/log/collect";
#elif POD_CONFIGURATION_UNIT_TEST
NSString *url = @"http://jaguar.gmei/log/collect";
#else
NSString *url = @"http://log.test.gengmei.cc/log/collect";
#endif
@try {
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[Phobos sharedClient].serverAPI]];
[request setValue:@"gzip" forHTTPHeaderField:@"Content-Encoding"];
request.HTTPBody = data;
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