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
466c6b64
Commit
466c6b64
authored
Sep 18, 2017
by
wangjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GMNetService添加http status=70006的处理
parent
dade30c3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
1 deletion
+25
-1
Contents.json
...tService/Images.xcassets/AppIcon.appiconset/Contents.json
+20
-0
GMNetConstant.h
GMNetService/Classes/GMNetConstant.h
+1
-0
WMNetService.h
GMNetService/Classes/WMNetService.h
+1
-0
WMNetService.m
GMNetService/Classes/WMNetService.m
+3
-1
No files found.
Example/GMNetService/Images.xcassets/AppIcon.appiconset/Contents.json
View file @
466c6b64
{
{
"images"
:
[
"images"
:
[
{
"idiom"
:
"iphone"
,
"size"
:
"20x20"
,
"scale"
:
"2x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"20x20"
,
"scale"
:
"3x"
},
{
{
"idiom"
:
"iphone"
,
"idiom"
:
"iphone"
,
"size"
:
"29x29"
,
"size"
:
"29x29"
,
...
@@ -30,6 +40,16 @@
...
@@ -30,6 +40,16 @@
"size"
:
"60x60"
,
"size"
:
"60x60"
,
"scale"
:
"3x"
"scale"
:
"3x"
},
},
{
"idiom"
:
"ipad"
,
"size"
:
"20x20"
,
"scale"
:
"1x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"20x20"
,
"scale"
:
"2x"
},
{
{
"idiom"
:
"ipad"
,
"idiom"
:
"ipad"
,
"size"
:
"29x29"
,
"size"
:
"29x29"
,
...
...
GMNetService/Classes/GMNetConstant.h
View file @
466c6b64
...
@@ -23,6 +23,7 @@ typedef NS_ENUM(NSInteger, HttpStatusCode) {
...
@@ -23,6 +23,7 @@ typedef NS_ENUM(NSInteger, HttpStatusCode) {
HttpStatusCodeSuccess
=
200
,
HttpStatusCodeSuccess
=
200
,
HttpStatusCodeError
=
500
,
HttpStatusCodeError
=
500
,
HttpStatusCodeUnauthorized
=
403
,
HttpStatusCodeUnauthorized
=
403
,
HttpStatusCodeAuthentication
=
70006
//实名认证
};
};
/** @brief Http方法枚举 */
/** @brief Http方法枚举 */
...
...
GMNetService/Classes/WMNetService.h
View file @
466c6b64
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
@property
(
nonatomic
,
strong
)
NSString
*
webHost
;
@property
(
nonatomic
,
strong
)
NSString
*
webHost
;
@property
(
nonatomic
,
strong
)
NSString
*
loginExpiredName
;
@property
(
nonatomic
,
strong
)
NSString
*
loginExpiredName
;
@property
(
nonatomic
,
strong
)
NSString
*
urlCommonParameters
;
@property
(
nonatomic
,
strong
)
NSString
*
urlCommonParameters
;
@property
(
nonatomic
,
copy
)
NSString
*
loginAuthenticationName
;
//普通请求网络之前调用
//普通请求网络之前调用
@property
(
nonatomic
,
copy
)
void
(
^
beforeAction
)
(
void
);
@property
(
nonatomic
,
copy
)
void
(
^
beforeAction
)
(
void
);
//上传操作之前调用,返回一个HttpHeader, 类型是NSDictionary
//上传操作之前调用,返回一个HttpHeader, 类型是NSDictionary
...
...
GMNetService/Classes/WMNetService.m
View file @
466c6b64
...
@@ -210,7 +210,9 @@
...
@@ -210,7 +210,9 @@
// TODO: 可以根据不同的statusCode返回不同的提示
// TODO: 可以根据不同的statusCode返回不同的提示
if
(
statusCode
==
HttpStatusCodeUnauthorized
){
if
(
statusCode
==
HttpStatusCodeUnauthorized
){
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
_loginExpiredName
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
_loginExpiredName
object
:
nil
];
}
else
{
}
else
if
(
statusCode
==
HttpStatusCodeAuthentication
)
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
_loginAuthenticationName
object
:
nil
];
}
else
{
errorStr
=
[
NSString
stringWithFormat
:
@"网络错误: %ld"
,
statusCode
];
errorStr
=
[
NSString
stringWithFormat
:
@"网络错误: %ld"
,
statusCode
];
debugLog
(
@"%@"
,
errorStr
);
debugLog
(
@"%@"
,
errorStr
);
}
}
...
...
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