升级了一键登录SDK版本

This commit is contained in:
fengshuo
2022-02-23 14:57:39 +08:00
parent 253768d461
commit d8849882d4
3 changed files with 65 additions and 71 deletions

View File

@@ -13,7 +13,7 @@ target 'xplan-ios' do
pod 'MBProgressHUD'
pod 'FFPopup'
#易盾 本机一键登录
pod 'NTESQuickPass', '~> 2.1.6'
pod 'NTESQuickPass'
#模型转化
pod 'MJExtension'
#图片加载

View File

@@ -46,7 +46,9 @@ PODS:
- MOBFoundation (>= 3.2.9)
- MOBFoundation (3.2.27)
- NIMSDK_LITE (7.8.5)
- NTESQuickPass (2.1.9)
- NTESBaseComponent (1.4)
- NTESQuickPass (3.2.6):
- NTESBaseComponent
- pop (1.0.12)
- Protobuf (3.19.1)
- Qiniu (8.3.2):
@@ -101,7 +103,7 @@ DEPENDENCIES:
- mob_sharesdk/ShareSDKPlatforms/QQ
- mob_sharesdk/ShareSDKPlatforms/WeChat
- NIMSDK_LITE (~> 7.8.3)
- NTESQuickPass (~> 2.1.6)
- NTESQuickPass
- pop (~> 1.0.12)
- Qiniu
- ReactiveObjC
@@ -117,6 +119,9 @@ DEPENDENCIES:
- YYWebImage (~> 1.0.5)
SPEC REPOS:
https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git:
- NTESBaseComponent
- NTESQuickPass
trunk:
- AFNetworking
- AgoraRtcEngine_iOS
@@ -135,7 +140,6 @@ SPEC REPOS:
- mob_sharesdk
- MOBFoundation
- NIMSDK_LITE
- NTESQuickPass
- pop
- Protobuf
- Qiniu
@@ -175,7 +179,8 @@ SPEC CHECKSUMS:
mob_sharesdk: a60006891a079486ff3269ed326adfa05a967c01
MOBFoundation: efdc3ce6b843fbc10ae8c1c6122a02b0d845b39b
NIMSDK_LITE: 8e28ae0a26dd1dccc4684b697381f0a72a733f51
NTESQuickPass: 8431dc52737c95883cd382c2ee75664d58f39377
NTESBaseComponent: 9e97373eec7e5a26c39db26477bf99a37ee9e71a
NTESQuickPass: 781bd12ee63681389fe9b646c837fa76e3a00e6e
pop: d582054913807fd11fd50bfe6a539d91c7e1a55a
Protobuf: 3724efa50cb2846d7ccebc8691c574e85fd74471
Qiniu: 61f1e2fdfb35b37f98c8f03a718faf12652f9994
@@ -194,6 +199,6 @@ SPEC CHECKSUMS:
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928
PODFILE CHECKSUM: a3a94c2fefbbf41722d4664a7a8c01ae0311c8e1
PODFILE CHECKSUM: 1fa9307cda450b37197ea1356c5e0679d82d1d41
COCOAPODS: 1.11.0

View File

@@ -255,68 +255,56 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
}
- (void)phoneQuickLogin {
[self showLoading];
// 使shouldQuickLogin
@weakify(self)
NTESQuickLoginManager *qlManager = [NTESQuickLoginManager sharedInstance];
BOOL shouldQL = [qlManager shouldQuickLogin];
if (!shouldQL) {
[self phoneQuickLoginFail];
return;
}
[qlManager registerWithBusinessID:KeyWithType(KeyType_NTESQuickLoginBusinessId) timeout:3*1000 configURL:nil extData:nil completion:^(NSDictionary * _Nullable params, BOOL regSuccess) {
@strongify(self)
if (!regSuccess) {
dispatch_main_sync_safe(^{
[self phoneQuickLoginFail];
});
return;
}
NSString *token = [params objectForKey:@"token"];
[qlManager getPhoneNumberCompletion:^(NSDictionary * _Nonnull resultDic) {
@strongify(self)
NSNumber *boolNum = [resultDic objectForKey:@"success"];
BOOL getPhoneNumberSuccess = [boolNum boolValue];
if (!getPhoneNumberSuccess) {
dispatch_main_sync_safe(^{
[self phoneQuickLoginFail];
});
return;
}
[self configQuickLogin];
[qlManager CUCMCTAuthorizeLoginCompletion:^(NSDictionary * _Nonnull resultDic) {
@strongify(self)
NSNumber *boolNum = [resultDic objectForKey:@"success"];
BOOL authSuccess = [boolNum boolValue];
if (!authSuccess) {
dispatch_main_sync_safe(^{
NSString *resultCode = [resultDic objectForKey:@"resultCode"];
//
if ([resultCode isEqualToString:@"200020"] ||
[resultCode isEqualToString:@"10104"]) {
[self hideHUD];
} else {
[self phoneQuickLoginFail];
}
});
return;
}
dispatch_main_sync_safe(^{
@strongify(self)
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventOneClickLoginSuccess];
// // acessToken
[self hideHUD];
[self dismissViewControllerAnimated:YES completion:nil];
[self.presenter phoneQuickLogin:resultDic[@"accessToken"] token:token];
});
}];
}];
}];
[self showLoading];
// 使shouldQuickLogin
@weakify(self)
NTESQuickLoginManager *qlManager = [NTESQuickLoginManager sharedInstance];
BOOL shouldQL = [qlManager shouldQuickLogin];
if (!shouldQL) {
[self phoneQuickLoginFail];
return;
}
[qlManager registerWithBusinessID:KeyWithType(KeyType_NTESQuickLoginBusinessId) configURL:nil extData:nil];
[qlManager getPhoneNumberCompletion:^(NSDictionary * _Nonnull resultDic) {
@strongify(self)
NSNumber *boolNum = [resultDic objectForKey:@"success"];
NSString * token = [resultDic objectForKey:@"token"];
BOOL getPhoneNumberSuccess = [boolNum boolValue];
if (!getPhoneNumberSuccess || token.length <= 0) {
dispatch_main_sync_safe(^{
[self phoneQuickLoginFail];
});
return;
}
[self configQuickLogin];
[qlManager CUCMCTAuthorizeLoginCompletion:^(NSDictionary * _Nonnull resultDic) {
@strongify(self)
NSNumber *boolNum = [resultDic objectForKey:@"success"];
BOOL authSuccess = [boolNum boolValue];
if (!authSuccess) {
dispatch_main_sync_safe(^{
NSString *resultCode = [resultDic objectForKey:@"resultCode"];
//
if ([resultCode isEqualToString:@"200020"] ||
[resultCode isEqualToString:@"10104"]) {
[self hideHUD];
} else {
[self phoneQuickLoginFail];
}
});
return;
}
dispatch_main_sync_safe(^{
@strongify(self)
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventOneClickLoginSuccess];
// // acessToken
[self hideHUD];
[self dismissViewControllerAnimated:YES completion:nil];
[self.presenter phoneQuickLogin:resultDic[@"accessToken"] token:token];
});
}];
}];
}
- (void)phoneQuickLoginFail {
@@ -344,7 +332,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
CMModel.logoHeight = 95;
CMModel.logoOffsetTopY = 30;
CMModel.navText = @"一键登录";
CMModel.navTextColor = UIColor.whiteColor;
CMModel.navTextColor = [ThemeColor mainTextColor];
CMModel.navTextFont = [UIFont boldSystemFontOfSize:18];
CMModel.navReturnImg = [UIImage imageNamed:@"common_nav_back"];
@@ -361,9 +349,9 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
CMModel.logBtnTextFont = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
CMModel.numberOffsetTopY = 170;
CMModel.numberColor = UIColor.whiteColor;
CMModel.numberColor = [ThemeColor mainTextColor];
CMModel.numberFont = [UIFont boldSystemFontOfSize:20];
CMModel.brandColor = UIColor.whiteColor;
CMModel.brandColor = [ThemeColor mainTextColor];
CMModel.uncheckedImg = [UIImage imageNamed:@"common_checkbox_uncheck"];
CMModel.checkedImg = [UIImage imageNamed:@"common_checkbox_checked"];
@@ -378,6 +366,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
CMModel.appPrivacyText = @"同意《默认》,并授权音游获取本机号码。";
CMModel.privacyFont = [UIFont systemFontOfSize:12];
CMModel.protocolColor = [ThemeColor appMainColor];
CMModel.appPrivacyOriginBottomMargin = 30;
CMModel.backActionBlock = ^{ //
[self hideHUD];