登录修改

This commit is contained in:
liyuhua
2023-08-29 12:13:17 +08:00
parent dc1d1b46e7
commit b8196c5e49

View File

@@ -47,7 +47,7 @@
if (profile) {
[AccountInfoStorage instance].thirdUserInfo.userName = profile.name;
[AccountInfoStorage instance].thirdUserInfo.avatarUrl = profile.imageURL.absoluteString;
[self loginWithThirdPartWithType:ThirdLoginType_FB];
}
}];
}
@@ -165,12 +165,15 @@
[FBSDKAccessToken setCurrentAccessToken:nil];
FBSDKLoginManager *manager = [[FBSDKLoginManager alloc] init];
[manager logOut];
[XNDJTDDLoadingTool showOnlyView:kWindow];
[manager logInWithPermissions:@[@"public_profile"]
fromViewController:presentingViewController
handler:^(FBSDKLoginManagerLoginResult * _Nullable result, NSError * _Nullable error) {
if (error) {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
} else if (result.isCancelled) {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")];
} else {
ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init];
@@ -178,6 +181,7 @@
userInfo.access_token = result.token.tokenString;
userInfo.unionid = result.token.userID;
[AccountInfoStorage instance].thirdUserInfo = userInfo;
[self loginWithThirdPartWithType:ThirdLoginType_FB];
}
}];
}