Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMPhobos
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMPhobos
Commits
015f2ae1
Commit
015f2ae1
authored
Aug 23, 2017
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将上传url配置外露
parent
4472a7d0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
GMViewController.m
Example/GMPhobos/GMViewController.m
+11
-1
Phobos.h
Pod/Classes/Phobos.h
+4
-0
PhobosUtil.m
Pod/Classes/PhobosUtil.m
+2
-8
No files found.
Example/GMPhobos/GMViewController.m
View file @
015f2ae1
...
...
@@ -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
];
...
...
Pod/Classes/Phobos.h
View file @
015f2ae1
...
...
@@ -76,6 +76,10 @@
*/
@property
(
strong
,
nonatomic
)
NSMutableDictionary
*
userType
;
/**
数据接收的服务器API
*/
@property
(
copy
,
nonatomic
)
NSString
*
serverAPI
;
#pragma mark - 事件采集
/**
...
...
Pod/Classes/PhobosUtil.m
View file @
015f2ae1
...
...
@@ -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"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment