Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c44f7f9

Browse files
未登录提示 - bugfix
1 parent de770ad commit c44f7f9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎Coding_iOS/Util/OC_Category/NSObject+Common.m‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,13 @@ -(id)handleResponse:(id)responseJSON autoShowError:(BOOL)autoShowError{
312312
error = [NSError errorWithDomain:[NSObject baseURLStr] code:resultCode.intValue userInfo:responseJSON];
313313

314314
if (resultCode.intValue == 1000 || resultCode.intValue == 3207) {//用户未登录
315-
if ([Login isLogin]) {//已登录的状态要抹掉
316-
[Login doLogout];
317-
[((AppDelegate *)[UIApplication sharedApplication].delegate) setupLoginViewController];
318-
kTipAlert(@"%@", [NSObject tipFromError:error]);
315+
if ([Login isLogin]) {
316+
[Login doLogout];//已登录的状态要抹掉
317+
//更新 UI 要延迟 >1.0 秒,否则屏幕可能会不响应触摸事件。。暂不知为何
318+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
319+
[((AppDelegate *)[UIApplication sharedApplication].delegate) setupLoginViewController];
320+
kTipAlert(@"%@", [NSObject tipFromError:error]);
321+
});
319322
}
320323
}else{
321324
if (autoShowError) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /