Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
GMNetService
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
GMNetService
Commits
49b8b437
Commit
49b8b437
authored
Nov 02, 2018
by
艾娇平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拼接apiHost后,加上局部变量fullUrlString
parent
a953ff89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
WMNetService.m
GMNetService/Classes/WMNetService.m
+6
-6
No files found.
GMNetService/Classes/WMNetService.m
View file @
49b8b437
...
...
@@ -57,38 +57,38 @@
_beforeAction
();
}
URL
String
=
[
NSString
stringWithFormat
:
@"%@%@"
,
self
.
apiHost
,
URLString
];
NSString
*
fullUrl
String
=
[
NSString
stringWithFormat
:
@"%@%@"
,
self
.
apiHost
,
URLString
];
if
(
method
==
HttpMethodGet
)
{
[
networking
GET
:
URL
String
parameters
:
parameters
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
networking
GET
:
fullUrl
String
parameters
:
parameters
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
self
successWithTask
:
task
responseObject
:
responseObject
success
:
success
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
[
self
failureWithTask
:
task
error
:
error
failed
:
failed
];
}];
}
else
if
(
method
==
HttpMethodPost
){
[
networking
POST
:
URL
String
parameters
:
parameters
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
networking
POST
:
fullUrl
String
parameters
:
parameters
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
self
successWithTask
:
task
responseObject
:
responseObject
success
:
success
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
[
self
failureWithTask
:
task
error
:
error
failed
:
failed
];
}];
}
else
if
(
method
==
HttpMethodDelete
){
[
networking
DELETE
:
URL
String
parameters
:
parameters
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
networking
DELETE
:
fullUrl
String
parameters
:
parameters
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
self
successWithTask
:
task
responseObject
:
responseObject
success
:
success
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
[
self
failureWithTask
:
task
error
:
error
failed
:
failed
];
}];
}
else
if
(
method
==
HttpMethodPatch
){
[
networking
PATCH
:
URL
String
parameters
:
parameters
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
networking
PATCH
:
fullUrl
String
parameters
:
parameters
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
self
successWithTask
:
task
responseObject
:
responseObject
success
:
success
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
[
self
failureWithTask
:
task
error
:
error
failed
:
failed
];
}];
}
else
if
(
method
==
HttpMethodPut
){
[
networking
PUT
:
URL
String
parameters
:
parameters
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
networking
PUT
:
fullUrl
String
parameters
:
parameters
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
self
successWithTask
:
task
responseObject
:
responseObject
success
:
success
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
[
self
failureWithTask
:
task
error
:
error
failed
:
failed
];
...
...
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