diff --git a/YuMi/Modules/YMLogin/Presenter/LoginVerifCodePresent.m b/YuMi/Modules/YMLogin/Presenter/LoginVerifCodePresent.m index 3c2e0ed7..15ad03da 100644 --- a/YuMi/Modules/YMLogin/Presenter/LoginVerifCodePresent.m +++ b/YuMi/Modules/YMLogin/Presenter/LoginVerifCodePresent.m @@ -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) { diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.m b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.m index 542fe7d9..0633dab2 100644 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.m +++ b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.m @@ -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) { diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m index 96518c81..63b97546 100644 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m +++ b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m @@ -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)); diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index 8f4cdb58..3b2b9f58 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -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]; diff --git a/YuMi/Structure/MVP/Model/AccountInfoStorage.h b/YuMi/Structure/MVP/Model/AccountInfoStorage.h index 5d54ff29..f61e7279 100644 --- a/YuMi/Structure/MVP/Model/AccountInfoStorage.h +++ b/YuMi/Structure/MVP/Model/AccountInfoStorage.h @@ -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; ///如果是第三方登录的话 保存一下用户信息