优化手机登录
This commit is contained in:
@@ -47,7 +47,6 @@
|
||||
|
||||
if (accountModel && accountModel.access_token.length > 0) {
|
||||
[[AccountInfoStorage instance] saveAccountInfo:accountModel];
|
||||
[AccountInfoStorage instance].isPhoneLogin = YES;
|
||||
}
|
||||
[[self getView] loginWithPhoenSuccess];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
@@ -228,7 +228,8 @@
|
||||
#pragma mark - LoginVerifCodeProtocol
|
||||
- (void)loginWithPhoenSuccess{
|
||||
[XNDJTDDLoadingTool hideOnlyView:self.view];
|
||||
[[NSUserDefaults standardUserDefaults]removeObjectForKey:@"kLoginSuccessType"];
|
||||
[[NSUserDefaults standardUserDefaults]setValue:@(ThirdLoginType_Phone) forKey:@"kLoginSuccessType"];
|
||||
[[NSUserDefaults standardUserDefaults]synchronize];
|
||||
[self showSuccessToast:YMLocalizedString(@"XPLoginPhoneViewController1")];
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
|
@@ -176,19 +176,21 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
|
||||
|
||||
id type = [[NSUserDefaults standardUserDefaults]valueForKey:@"kLoginSuccessType"];
|
||||
if(type != nil){
|
||||
[self.view addSubview:self.nextView];
|
||||
[self.nextView addSubview:self.nextLabel];
|
||||
|
||||
UIButton *typeButton ;
|
||||
if([type intValue] == 5){
|
||||
if([type intValue] == ThirdLoginType_Apple){
|
||||
typeButton = self.appleButton;
|
||||
}else if([type intValue] == 8){
|
||||
}else if([type intValue] == ThirdLoginType_Gmail){
|
||||
typeButton = self.googleButtonView;
|
||||
}else if([type intValue] == 10){
|
||||
}else if([type intValue] == ThirdLoginType_FB){
|
||||
typeButton = self.fbButtonView;
|
||||
}else{
|
||||
}else if([type intValue] == ThirdLoginType_Line){
|
||||
typeButton = self.lineButtonView;
|
||||
}
|
||||
if(typeButton == nil){
|
||||
return;
|
||||
}
|
||||
[self.view addSubview:self.nextView];
|
||||
[self.nextView addSubview:self.nextLabel];
|
||||
[self.nextView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(28));
|
||||
make.width.mas_equalTo(kGetScaleWidth(70));
|
||||
|
@@ -245,13 +245,12 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
return;
|
||||
}
|
||||
if (userInfo.nick == nil || userInfo.avatar == nil) {
|
||||
if([AccountInfoStorage instance].isPhoneLogin == YES){
|
||||
id type = [[NSUserDefaults standardUserDefaults]valueForKey:@"kLoginSuccessType"];
|
||||
if(type != nil && [type intValue] == ThirdLoginType_Phone){
|
||||
[self.presenter getAuthorizationCodeInfo];
|
||||
}else{
|
||||
[self completeUserInfo];
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
[self initTabs:YES];
|
||||
|
@@ -12,8 +12,7 @@
|
||||
@interface AccountInfoStorage : NSObject
|
||||
|
||||
@property (nonatomic, strong, readonly) AccountModel *accountModel;
|
||||
///是否手机号登录,用于决定是否请求授权码
|
||||
@property(nonatomic,assign) BOOL isPhoneLogin;
|
||||
|
||||
///判断是否正在请求ticket,yes的话,不能用ticket请求数据,不然会出现401,要重新登录
|
||||
@property (nonatomic,assign) BOOL isRequestRicket;
|
||||
///如果是第三方登录的话 保存一下用户信息
|
||||
|
Reference in New Issue
Block a user