优化手机登录

This commit is contained in:
liyuhua
2023-08-18 10:05:07 +08:00
parent c320950152
commit 6416529e04
5 changed files with 14 additions and 14 deletions

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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));

View File

@@ -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];

View File

@@ -12,8 +12,7 @@
@interface AccountInfoStorage : NSObject
@property (nonatomic, strong, readonly) AccountModel *accountModel;
///是否手机号登录,用于决定是否请求授权码
@property(nonatomic,assign) BOOL isPhoneLogin;
///判断是否正在请求ticketyes的话不能用ticket请求数据不然会出现401要重新登录
@property (nonatomic,assign) BOOL isRequestRicket;
///如果是第三方登录的话 保存一下用户信息