Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
关于ios授权登陆卡死,闪退的处理 (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
iNeedToCopy authored and yorkie committed Feb 26, 2019
1 parent 7af0b17 commit 797b22a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ios/RCTWeChat.m
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,12 @@ -(void) onResp:(BaseResp*)resp
body[@"country"] =r.country;
body[@"type"] = @"SendAuth.Resp";

if (resp.errCode == WXSuccess)
{
[body addEntriesFromDictionary:@{@"appid":self.appId, @"code" :r.code}];
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
if (resp.errCode == WXSuccess) {
if (self.appId && r) {
// ios第一次获取不到appid会卡死,加个判断OK
[body addEntriesFromDictionary:@{@"appid":self.appId, @"code":r.code}];
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
}
}
else {
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
Expand Down

0 comments on commit 797b22a

Please sign in to comment.