Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ios1x
Overview
Overview
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
ios1x
Commits
ffda5a02
Commit
ffda5a02
authored
Sep 05, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u timeout
parent
f8f9c8a3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
19 deletions
+24
-19
KWMAPIManager.m
iCemarose/Class/Api/KWMAPIManager.m
+23
-18
Info.plist
iCemarose/Info.plist
+1
-1
No files found.
iCemarose/Class/Api/KWMAPIManager.m
View file @
ffda5a02
...
@@ -166,12 +166,10 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
...
@@ -166,12 +166,10 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
NSURL
*
url
=
[
NSURL
URLWithString
:
self
.
baseUrl
];
NSURL
*
url
=
[
NSURL
URLWithString
:
self
.
baseUrl
];
AFHTTPSessionManager
*
sessionManager
=
[[
AFHTTPSessionManager
alloc
]
initWithBaseURL
:
url
];
AFHTTPSessionManager
*
sessionManager
=
[[
AFHTTPSessionManager
alloc
]
initWithBaseURL
:
url
];
//设置超时时间为10秒
//设置超时时间为10秒
[
sessionManager
.
requestSerializer
willChangeValueForKey
:
@"timeoutInterval"
];
//
[sessionManager.requestSerializer willChangeValueForKey:@"timeoutInterval"];
sessionManager
.
requestSerializer
.
timeoutInterval
=
10
.
f
;
sessionManager
.
requestSerializer
.
timeoutInterval
=
10
.
f
;
[
sessionManager
.
requestSerializer
didChangeValueForKey
:
@"timeoutInterval"
];
// [sessionManager.requestSerializer didChangeValueForKey:@"timeoutInterval"];
if
(
isJsonParameter
)
{
if
(
isJsonParameter
)
{
sessionManager
.
requestSerializer
=
[
AFJSONRequestSerializer
serializerWithWritingOptions
:
0
];
sessionManager
.
requestSerializer
=
[
AFJSONRequestSerializer
serializerWithWritingOptions
:
0
];
...
@@ -199,6 +197,7 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
...
@@ -199,6 +197,7 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
apiPath
:
(
NSString
*
)
apiPath
apiPath
:
(
NSString
*
)
apiPath
parameters
:
(
NSDictionary
*
)
parameters
parameters
:
(
NSDictionary
*
)
parameters
filePaths
:
(
NSDictionary
*
)
filePaths
filePaths
:
(
NSDictionary
*
)
filePaths
timeout
:
(
NSTimeInterval
)
timeout
images
:
(
NSArray
*
)
images
images
:
(
NSArray
*
)
images
jsonParameter
:
(
BOOL
)
isJsonParameter
jsonParameter
:
(
BOOL
)
isJsonParameter
result
:
(
Class
)
result
result
:
(
Class
)
result
...
@@ -219,6 +218,9 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
...
@@ -219,6 +218,9 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
success
:
success
success
:
success
failure
:
failure
];
failure
:
failure
];
AFHTTPSessionManager
*
sessionManager
=
[
self
buildSessionManager
:
isJsonParameter
];
AFHTTPSessionManager
*
sessionManager
=
[
self
buildSessionManager
:
isJsonParameter
];
if
(
timeout
)
{
[
sessionManager
.
requestSerializer
setTimeoutInterval
:
timeout
];
}
//app version code
//app version code
// static NSString *KEY_VERSION_CODE = @"version_code";
// static NSString *KEY_VERSION_CODE = @"version_code";
// NSString *build = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
// NSString *build = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
...
@@ -323,6 +325,7 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
...
@@ -323,6 +325,7 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
apiPath
:
apiPath
apiPath
:
apiPath
parameters
:
parameters
parameters
:
parameters
filePaths
:
filePaths
filePaths
:
filePaths
timeout
:
0
images
:
nil
images
:
nil
jsonParameter
:
isJsonParameter
jsonParameter
:
isJsonParameter
result
:
result
result
:
result
...
@@ -811,13 +814,14 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
...
@@ -811,13 +814,14 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
success
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
KWMCheckoutPayResult
*
result
))
success
success
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
KWMCheckoutPayResult
*
result
))
success
failure
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
NSError
*
error
))
failure
{
failure
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
NSError
*
error
))
failure
{
NSString
*
apiPath
=
[
NSString
stringWithFormat
:
@"https://%@/wechatpay/app/unified_order"
,
Pay_API_DOMAIN
];
NSString
*
apiPath
=
[
NSString
stringWithFormat
:
@"https://%@/wechatpay/app/unified_order"
,
Pay_API_DOMAIN
];
return
[
self
startSessionTask
:
KWMHTTPMethodPOST
// return [self startSessionTask:KWMHTTPMethodPOST
apiPath
:
apiPath
// apiPath:apiPath
parameters
:
parameters
// parameters:parameters
result
:
[
KWMCheckoutPayResult
class
]
// result:[KWMCheckoutPayResult class]
model
:
[
KWMWechatPayData
class
]
// model:[KWMWechatPayData class]
success
:
success
// success:success
failure
:
failure
];
// failure:failure];
return
[
self
startSessionTask
:
KWMHTTPMethodPOST
apiPath
:
apiPath
parameters
:
parameters
filePaths
:
nil
timeout
:
30
images
:
nil
jsonParameter
:
NO
result
:
[
KWMCheckoutPayResult
class
]
model
:
[
KWMWechatPayData
class
]
success
:
success
failure
:
failure
];
}
}
/**
/**
...
@@ -834,13 +838,14 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
...
@@ -834,13 +838,14 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
success
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
KWMCheckoutPayResult
*
result
))
success
success
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
KWMCheckoutPayResult
*
result
))
success
failure
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
NSError
*
error
))
failure
{
failure
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
NSError
*
error
))
failure
{
NSString
*
apiPath
=
[
NSString
stringWithFormat
:
@"https://%@/alipay/app/unified_order"
,
Pay_API_DOMAIN
];
NSString
*
apiPath
=
[
NSString
stringWithFormat
:
@"https://%@/alipay/app/unified_order"
,
Pay_API_DOMAIN
];
return
[
self
startSessionTask
:
KWMHTTPMethodPOST
// return [self startSessionTask:KWMHTTPMethodPOST
apiPath
:
apiPath
// apiPath:apiPath
parameters
:
parameters
// parameters:parameters
result
:
[
KWMCheckoutPayResult
class
]
// result:[KWMCheckoutPayResult class]
model
:
nil
// model:nil
success
:
success
// success:success
failure
:
failure
];
// failure:failure];
return
[
self
startSessionTask
:
KWMHTTPMethodPOST
apiPath
:
apiPath
parameters
:
parameters
filePaths
:
nil
timeout
:
30
images
:
nil
jsonParameter
:
NO
result
:
[
KWMCheckoutPayResult
class
]
model
:
nil
success
:
success
failure
:
failure
];
}
}
-
(
NSURLSessionDataTask
*
)
wechatPayOrderQuery
:
(
NSDictionary
*
)
parameters
-
(
NSURLSessionDataTask
*
)
wechatPayOrderQuery
:
(
NSDictionary
*
)
parameters
...
...
iCemarose/Info.plist
View file @
ffda5a02
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
2017090
411
<
/string
>
<
string
>
2017090
512
<
/string
>
<
k
e
y
>
ITSAppUsesNonExemptEncryption
<
/k
e
y
>
<
k
e
y
>
ITSAppUsesNonExemptEncryption
<
/k
e
y
>
<
fa
ls
e
/
>
<
fa
ls
e
/
>
<
k
e
y
>
LSApplicationQueriesSchemes
<
/k
e
y
>
<
k
e
y
>
LSApplicationQueriesSchemes
<
/k
e
y
>
...
...
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