XCHUDTool封装到BaseViewController
This commit is contained in:
@@ -74,4 +74,4 @@ SPEC CHECKSUMS:
|
|||||||
|
|
||||||
PODFILE CHECKSUM: 82677bb54bd8940f2a6cc6f00b6eaefb58c721b7
|
PODFILE CHECKSUM: 82677bb54bd8940f2a6cc6f00b6eaefb58c721b7
|
||||||
|
|
||||||
COCOAPODS: 1.11.0
|
COCOAPODS: 1.10.1
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "BaseViewController.h"
|
||||||
#import "BaseMvpProtocol.h"
|
#import "BaseMvpProtocol.h"
|
||||||
#import "HttpRequestHelper.h"
|
#import "HttpRequestHelper.h"
|
||||||
|
|
||||||
@@ -18,6 +19,7 @@ typedef void(^HttpFail)(NSInteger code, NSString * _Nullable msg);
|
|||||||
|
|
||||||
- (void)attatchView:(id)view;
|
- (void)attatchView:(id)view;
|
||||||
- (id)getView;
|
- (id)getView;
|
||||||
|
- (BaseViewController *)getBaseVC;
|
||||||
- (void)detatchView;
|
- (void)detatchView;
|
||||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail;
|
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail;
|
||||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading;
|
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading;
|
||||||
|
@@ -6,7 +6,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "BaseMvpPresenter.h"
|
#import "BaseMvpPresenter.h"
|
||||||
#import "XCHUDTool.h"
|
|
||||||
|
|
||||||
@interface BaseMvpPresenter()
|
@interface BaseMvpPresenter()
|
||||||
|
|
||||||
@@ -24,8 +23,12 @@
|
|||||||
return self.view;
|
return self.view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BaseViewController *)getBaseVC {
|
||||||
|
return ((BaseViewController *) [self getView]);
|
||||||
|
}
|
||||||
|
|
||||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail {
|
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail {
|
||||||
return [self createHttpCompletion:success fail:fail showLoading:YES errorToast:YES];
|
return [self createHttpCompletion:success fail:fail showLoading:NO errorToast:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading {
|
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading {
|
||||||
@@ -33,16 +36,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail errorToast:(BOOL)toast {
|
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail errorToast:(BOOL)toast {
|
||||||
return [self createHttpCompletion:success fail:fail showLoading:YES errorToast:toast];
|
return [self createHttpCompletion:success fail:fail showLoading:NO errorToast:toast];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading errorToast:(BOOL)toast {
|
- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading errorToast:(BOOL)toast {
|
||||||
if (loading) {
|
if (loading) {
|
||||||
[XCHUDTool showLoading];
|
[[self getBaseVC] showLoading];
|
||||||
}
|
}
|
||||||
return ^(BaseModel *data, NSInteger code, NSString * _Nullable msg) {
|
return ^(BaseModel *data, NSInteger code, NSString * _Nullable msg) {
|
||||||
if (loading) {
|
if (loading) {
|
||||||
[XCHUDTool hideHUD];
|
[[self getBaseVC] hideHUD];
|
||||||
}
|
}
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
success(data);
|
success(data);
|
||||||
@@ -59,7 +62,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (toast) {
|
if (toast) {
|
||||||
[XCHUDTool showErrorWithMessage:msg];
|
[[self getBaseVC] showErrorToast:msg];
|
||||||
}
|
}
|
||||||
fail(code, msg);
|
fail(code, msg);
|
||||||
};
|
};
|
||||||
|
@@ -33,6 +33,26 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
*/
|
*/
|
||||||
- (void)hideStatusBar;
|
- (void)hideStatusBar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
成功 toast
|
||||||
|
*/
|
||||||
|
- (void)showSuccessToast:(NSString *)msg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
失败 toast
|
||||||
|
*/
|
||||||
|
- (void)showErrorToast:(NSString *)msg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
加载 loading
|
||||||
|
*/
|
||||||
|
- (void)showLoading;
|
||||||
|
|
||||||
|
/**
|
||||||
|
隐藏 XCHUDTool
|
||||||
|
*/
|
||||||
|
- (void)hideHUD;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#import "BaseViewController.h"
|
#import "BaseViewController.h"
|
||||||
///Tool
|
///Tool
|
||||||
|
#import "XCHUDTool.h"
|
||||||
#import "ThemeColor.h"
|
#import "ThemeColor.h"
|
||||||
|
|
||||||
@interface BaseViewController ()
|
@interface BaseViewController ()
|
||||||
@@ -54,5 +55,21 @@
|
|||||||
[UIApplication sharedApplication].statusBarHidden = YES;
|
[UIApplication sharedApplication].statusBarHidden = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)showSuccessToast:(NSString *)msg {
|
||||||
|
[XCHUDTool showSuccessWithMessage:msg];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)showErrorToast:(NSString *)msg {
|
||||||
|
[XCHUDTool showErrorWithMessage:msg];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)showLoading {
|
||||||
|
[XCHUDTool showLoading];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)hideHUD {
|
||||||
|
[XCHUDTool hideHUD];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
[self openCutDownWithTotal:60];
|
[self openCutDownWithTotal:60];
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
} showLoading:NO errorToast:YES] mobile:phone type:[NSString stringWithFormat:@"%d", type]];
|
}] mobile:phone type:[NSString stringWithFormat:@"%d", type]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
[[self getView] phoneAndPasswordLoginSuccess];
|
[[self getView] phoneAndPasswordLoginSuccess];
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
}] phone:phone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
} showLoading:YES] phone:phone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -13,7 +13,6 @@
|
|||||||
#import "Api+Login.h"
|
#import "Api+Login.h"
|
||||||
///Tool
|
///Tool
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
#import "XCHUDTool.h"
|
|
||||||
///P
|
///P
|
||||||
#import "LoginProtocol.h"
|
#import "LoginProtocol.h"
|
||||||
///Model
|
///Model
|
||||||
@@ -30,10 +29,10 @@
|
|||||||
- (void)phoneQuickLogin:(NSString *)accessToken token:(NSString *)token {
|
- (void)phoneQuickLogin:(NSString *)accessToken token:(NSString *)token {
|
||||||
[Api phoneQuickLogin:[self createHttpCompletion:^(BaseModel *data) {
|
[Api phoneQuickLogin:[self createHttpCompletion:^(BaseModel *data) {
|
||||||
[[AccountInfoStorage instance] saveAccountInfo:[AccountModel modelWithDictionary:data.data]];
|
[[AccountInfoStorage instance] saveAccountInfo:[AccountModel modelWithDictionary:data.data]];
|
||||||
[[self getView] phoneQuickLoginSuccess];
|
[[self getView] loginSuccess];
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
// todo fail
|
// todo fail
|
||||||
}] accessToken:accessToken token:token];
|
} showLoading:YES] accessToken:accessToken token:token];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -81,33 +80,31 @@
|
|||||||
NSString * givenName = [user.credential rawData][@"fullName"][@"givenName"];
|
NSString * givenName = [user.credential rawData][@"fullName"][@"givenName"];
|
||||||
userInfo.userName = [NSString stringWithFormat:@"%@%@", familyName, givenName];
|
userInfo.userName = [NSString stringWithFormat:@"%@%@", familyName, givenName];
|
||||||
}
|
}
|
||||||
[self thirdLOginWithopenID:openid andUnionID:unionid access_token:access_token andType:type];
|
[self thirdLoginWithOpenID:openid andUnionID:unionid access_token:access_token andType:type];
|
||||||
} else if(state == SSDKResponseStateCancel) {///取消
|
} else if(state == SSDKResponseStateCancel) {///取消
|
||||||
[XCHUDTool hideHUD];
|
[[self getBaseVC] hideHUD];
|
||||||
[[self getView] thirdLoginCancel];
|
[[self getBaseVC] showErrorToast:@"登录取消"];
|
||||||
} else if (state == SSDKResponseStateFail) {///失败
|
} else if (state == SSDKResponseStateFail) {///失败
|
||||||
[XCHUDTool hideHUD];
|
[[self getBaseVC] hideHUD];
|
||||||
if (error.description) {
|
if (error.description) {
|
||||||
[[self getView] thirdLoginFailth:error.description];
|
[[self getBaseVC] showErrorToast:error.description];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)thirdLOginWithopenID:(NSString *)openId
|
- (void)thirdLoginWithOpenID:(NSString *)openId
|
||||||
andUnionID:(NSString *)unionID
|
andUnionID:(NSString *)unionID
|
||||||
access_token:(NSString *)access_token
|
access_token:(NSString *)access_token
|
||||||
andType:(ThirdLoginType)type {
|
andType:(ThirdLoginType)type {
|
||||||
NSString * typeStr = [NSString stringWithFormat:@"%lu", type];
|
NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type];
|
||||||
unionID = @"";
|
unionID = @"";
|
||||||
[Api loginWithThirdPartWithComplction:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api loginWithThirdPartWithComplction:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
[XCHUDTool hideHUD];
|
[[self getBaseVC] hideHUD];
|
||||||
AccountModel * model = [AccountModel modelWithDictionary:data.data];
|
AccountModel * model = [AccountModel modelWithDictionary:data.data];
|
||||||
if (model != nil) {
|
if (model != nil) {
|
||||||
[[AccountInfoStorage instance] saveAccountInfo:model];
|
[[AccountInfoStorage instance] saveAccountInfo:model];
|
||||||
[[self getView] thirdLoginSuccess];
|
[[self getView] loginSuccess];
|
||||||
} else {
|
|
||||||
[[self getView] thirdLoginFailth:@"登录失败"];
|
|
||||||
}
|
}
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
} showLoading:YES] openid:openId unionid:unionID access_token:access_token type:typeStr];
|
} showLoading:YES] openid:openId unionid:unionID access_token:access_token type:typeStr];
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
[self openCutDownWithTotal:60];
|
[self openCutDownWithTotal:60];
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
} showLoading:NO errorToast:YES] mobile:phone type:[NSString stringWithFormat:@"%d", type]];
|
}] mobile:phone type:[NSString stringWithFormat:@"%d", type]];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 使用手机号和验证码登录
|
/// 使用手机号和验证码登录
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
[[self getView] loginSuccess];
|
[[self getView] loginSuccess];
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
}] phone:phone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
} showLoading:YES] phone:phone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -11,14 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@protocol LoginProtocol <NSObject>
|
@protocol LoginProtocol <NSObject>
|
||||||
|
|
||||||
- (void)phoneQuickLoginSuccess;
|
- (void)loginSuccess;
|
||||||
|
|
||||||
///第三方登录取消
|
|
||||||
- (void)thirdLoginCancel;
|
|
||||||
///第三方登录失败
|
|
||||||
- (void)thirdLoginFailth:(NSString *)message;
|
|
||||||
///第三方登录成功
|
|
||||||
- (void)thirdLoginSuccess;
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
#import <ReactiveObjC/ReactiveObjC.h>
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "ThemeColor.h"
|
||||||
#import "XCHUDTool.h"
|
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
///Presenter
|
///Presenter
|
||||||
#import "LoginForgetPasswordPresent.h"
|
#import "LoginForgetPasswordPresent.h"
|
||||||
@@ -96,7 +95,7 @@
|
|||||||
[[self.codeView.authCodeButton rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
|
[[self.codeView.authCodeButton rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
|
||||||
@strongify(self);
|
@strongify(self);
|
||||||
if (self.phoneView.textField.text.length != 11) {
|
if (self.phoneView.textField.text.length != 11) {
|
||||||
[XCHUDTool showErrorWithMessage:@"请输入正确的手机号码"];
|
[self showErrorToast:@"请输入正确的手机号码"];
|
||||||
} else {
|
} else {
|
||||||
[self.presenter phoneSmsCode:self.phoneView.textField.text type:3];
|
[self.presenter phoneSmsCode:self.phoneView.textField.text type:3];
|
||||||
}
|
}
|
||||||
@@ -113,7 +112,7 @@
|
|||||||
///请求手机号的验证码成功
|
///请求手机号的验证码成功
|
||||||
- (void)phoneSmsCodeSuccess {
|
- (void)phoneSmsCodeSuccess {
|
||||||
self.codeView.authCodeButton.enabled= NO;
|
self.codeView.authCodeButton.enabled= NO;
|
||||||
[XCHUDTool showSuccessWithMessage:@"验证码发送成功"];
|
[self showSuccessToast:@"验证码发送成功"];
|
||||||
}
|
}
|
||||||
///倒计时进行中
|
///倒计时进行中
|
||||||
- (void)countDownWithCurrent:(int)current {
|
- (void)countDownWithCurrent:(int)current {
|
||||||
@@ -126,7 +125,7 @@
|
|||||||
}
|
}
|
||||||
///重置密码成功
|
///重置密码成功
|
||||||
- (void)resetPasswrodSuccess {
|
- (void)resetPasswrodSuccess {
|
||||||
[XCHUDTool showSuccessWithMessage:@"重置密码成功"];
|
[self showSuccessToast:@"重置密码成功"];
|
||||||
[self.navigationController popViewControllerAnimated:YES];
|
[self.navigationController popViewControllerAnimated:YES];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,6 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <ReactiveObjC/ReactiveObjC.h>
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "XCHUDTool.h"
|
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "ThemeColor.h"
|
#import "ThemeColor.h"
|
||||||
///Presenter
|
///Presenter
|
||||||
@@ -130,7 +129,7 @@
|
|||||||
|
|
||||||
#pragma mark - LoginPasswordProtocol
|
#pragma mark - LoginPasswordProtocol
|
||||||
- (void)phoneAndPasswordLoginSuccess {
|
- (void)phoneAndPasswordLoginSuccess {
|
||||||
[XCHUDTool showSuccessWithMessage:@"登录成功"];
|
[self showSuccessToast:@"登录成功"];
|
||||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,7 +10,6 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <ReactiveObjC/ReactiveObjC.h>
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "XCHUDTool.h"
|
|
||||||
#import "ThemeColor.h"
|
#import "ThemeColor.h"
|
||||||
///Presenter
|
///Presenter
|
||||||
#import "LoginVerifCodePresent.h"
|
#import "LoginVerifCodePresent.h"
|
||||||
@@ -134,7 +133,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)loginSuccess {
|
- (void)loginSuccess {
|
||||||
[XCHUDTool showSuccessWithMessage:@"登录成功"];
|
[self showSuccessToast:@"登录成功"];
|
||||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
///Tool
|
///Tool
|
||||||
#import "UIImage+Utils.h"
|
#import "UIImage+Utils.h"
|
||||||
#import "GCDHelper.h"
|
#import "GCDHelper.h"
|
||||||
#import "XCHUDTool.h"
|
|
||||||
#import "XPMacro.h"
|
#import "XPMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "ThemeColor.h"
|
||||||
#import "XPConstant.h"
|
#import "XPConstant.h"
|
||||||
@@ -239,7 +238,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)phoneQuickLogin {
|
- (void)phoneQuickLogin {
|
||||||
[XCHUDTool showLoading];
|
[self showLoading];
|
||||||
// 在使用一键登录之前,请先调用shouldQuickLogin方法,判断当前上网卡的网络环境和运营商是否可以一键登录
|
// 在使用一键登录之前,请先调用shouldQuickLogin方法,判断当前上网卡的网络环境和运营商是否可以一键登录
|
||||||
@weakify(self)
|
@weakify(self)
|
||||||
NTESQuickLoginManager *qlManager = [NTESQuickLoginManager sharedInstance];
|
NTESQuickLoginManager *qlManager = [NTESQuickLoginManager sharedInstance];
|
||||||
@@ -281,7 +280,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
//取消一键登录
|
//取消一键登录
|
||||||
if ([resultCode isEqualToString:@"200020"] ||
|
if ([resultCode isEqualToString:@"200020"] ||
|
||||||
[resultCode isEqualToString:@"10104"]) {
|
[resultCode isEqualToString:@"10104"]) {
|
||||||
[XCHUDTool hideHUD];
|
[self hideHUD];
|
||||||
} else {
|
} else {
|
||||||
[self phoneQuickLoginFail];
|
[self phoneQuickLoginFail];
|
||||||
}
|
}
|
||||||
@@ -293,7 +292,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
@strongify(self)
|
@strongify(self)
|
||||||
// [TTStatisticsService trackEvent:@"one_click_login_succeed" eventDescribe:@"一键登录成功"];
|
// [TTStatisticsService trackEvent:@"one_click_login_succeed" eventDescribe:@"一键登录成功"];
|
||||||
// // 取号成功,获取acessToken
|
// // 取号成功,获取acessToken
|
||||||
[XCHUDTool hideHUD];
|
[self hideHUD];
|
||||||
[self dismissViewControllerAnimated:YES completion:nil];
|
[self dismissViewControllerAnimated:YES completion:nil];
|
||||||
[self.presenter phoneQuickLogin:resultDic[@"accessToken"] token:token];
|
[self.presenter phoneQuickLogin:resultDic[@"accessToken"] token:token];
|
||||||
});
|
});
|
||||||
@@ -304,7 +303,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)phoneQuickLoginFail {
|
- (void)phoneQuickLoginFail {
|
||||||
[XCHUDTool showErrorWithMessage:@"一键登录失败,请检查手机网络状态。"];
|
[self showErrorToast:@"一键登录失败,请检查手机网络状态。"];
|
||||||
LoginPhoneViewController *inputPhoneVC = [[LoginPhoneViewController alloc] init];
|
LoginPhoneViewController *inputPhoneVC = [[LoginPhoneViewController alloc] init];
|
||||||
[self.navigationController pushViewController:inputPhoneVC animated:YES];
|
[self.navigationController pushViewController:inputPhoneVC animated:YES];
|
||||||
}
|
}
|
||||||
@@ -360,28 +359,16 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
CMModel.protocolColor = [ThemeColor appMainColor];
|
CMModel.protocolColor = [ThemeColor appMainColor];
|
||||||
|
|
||||||
CMModel.backActionBlock = ^{ //点击了返回按钮
|
CMModel.backActionBlock = ^{ //点击了返回按钮
|
||||||
[XCHUDTool hideHUD];
|
[self hideHUD];
|
||||||
};
|
};
|
||||||
dispatch_main_sync_safe(^{
|
dispatch_main_sync_safe(^{
|
||||||
[[NTESQuickLoginManager sharedInstance] setupModel:CMModel];
|
[[NTESQuickLoginManager sharedInstance] setupModel:CMModel];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
#pragma mark - LoginProtocol
|
#pragma mark - LoginProtocol
|
||||||
- (void)phoneQuickLoginSuccess {
|
- (void)loginSuccess {
|
||||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||||
}
|
[self showSuccessToast:@"登录成功"];
|
||||||
|
|
||||||
- (void)thirdLoginSuccess {
|
|
||||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
|
||||||
[XCHUDTool showSuccessWithMessage:@"登录成功"];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)thirdLoginCancel {
|
|
||||||
[XCHUDTool showSuccessWithMessage:@"取消登录"];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)thirdLoginFailth:(NSString *)message {
|
|
||||||
[XCHUDTool showErrorWithMessage:message];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Getters And Setters
|
#pragma mark - Getters And Setters
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
[[self getView] autoLoginSuccess];
|
[[self getView] autoLoginSuccess];
|
||||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
} showLoading:NO] access_token:accountModel.access_token issue_type:@"multi"];
|
}] access_token:accountModel.access_token issue_type:@"multi"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Reference in New Issue
Block a user