Commit 78828c4785703bfefa7bc55394529acd0cc2a636
1 parent
c2e34ed8
苹果登录增加参数
Showing
7 changed files
with
33 additions
and
9 deletions
.gitignore
0 → 100755
CNLiveBLoginModule/Classes/Controller/CNLiveLoginController.m
| ... | ... | @@ -26,10 +26,11 @@ |
| 26 | 26 | #import <CNLiveRequestBastKit/CNLiveNetworking.h> |
| 27 | 27 | #import <CNLiveBusinessTools/CNLiveBusinessTools.h> |
| 28 | 28 | #import <CNLiveManager/CNLiveManager.h> |
| 29 | +static NSString *const CNLiveReleasePlusBusinessSecretKey = @"eyJraWQiOiI3NDJDV1FLSzgzIiwiYWxnIjoiRVMyNTYifQ.eyJpc3MiOiI5NFg0OUdHM1pXIiwiaWF0IjoxNjU2OTAzMDg1LCJleHAiOjE2NzI0NTUwODUsImF1ZCI6Imh0dHBzOi8vYXBwbGVpZC5hcHBsZS5jb20iLCJzdWIiOiJjb20uY25saXZlLkNOTGl2ZU5ldFBsdXNCdXNpbmVzcyJ9.6t9LSj6V4EJgoexh8h6k-TUQyJEk_N2a7__xw5zfy_F-lL6mdw2WEBSH_34FC5lEk1DGcqrxyCUODBm3PifAFw"; | |
| 30 | +static NSString *const CNLiveDebugPlusBusinessSecretKey = @"eyJraWQiOiJKMjc4TUxRQk43IiwiYWxnIjoiRVMyNTYifQ.eyJpc3MiOiI5NFg0OUdHM1pXIiwiaWF0IjoxNjU2OTAzMTIzLCJleHAiOjE2NzI0NTUxMjMsImF1ZCI6Imh0dHBzOi8vYXBwbGVpZC5hcHBsZS5jb20iLCJzdWIiOiJjb20uY25saXZlLkNOTGl2ZU5ldFBsdXNCdXNpbmVzcy5EZWJ1ZyJ9.foKFK8onQRTZZSWyWnO7QyWt4AWQd7vz7_6BfksOvzy_Gqa5uc8as_SpULTL-_jW488g5BBvDJF2GzWLsYq7vw"; | |
| 29 | 31 | |
| 30 | 32 | |
| 31 | - | |
| 32 | -@interface CNLiveLoginController()<CNLiveLoginViewDelegate, CNLiveThreeLoginViewDelegate> | |
| 33 | +@interface CNLiveLoginController()<CNLiveLoginViewDelegate, CNLiveThreeLoginViewDelegate,CNLiveShareManagerDelegate> | |
| 33 | 34 | @property (nonatomic, weak) CNLiveLoginView *loginView; |
| 34 | 35 | @property (nonatomic, weak) CNLiveThreeLoginView *threeLoginView; |
| 35 | 36 | @property (nonatomic, weak) YYLabel *protocol; |
| ... | ... | @@ -49,6 +50,7 @@ |
| 49 | 50 | |
| 50 | 51 | - (void)viewDidLoad { |
| 51 | 52 | [super viewDidLoad]; |
| 53 | + [CNLiveShareManager shareDefaultsManager].delegate = self; | |
| 52 | 54 | // Do any additional setup after loading the view. |
| 53 | 55 | self.automaticallyAdjustsScrollViewInsets = NO; |
| 54 | 56 | self.view.backgroundColor = [UIColor whiteColor]; |
| ... | ... | @@ -86,7 +88,7 @@ |
| 86 | 88 | text.yy_color = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0]; |
| 87 | 89 | text.yy_font = [UIFont systemFontOfSize:14.0]; |
| 88 | 90 | __weak typeof(self) weakSelf = self; |
| 89 | - UIColor *color = BusinessLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 91 | + UIColor *color = AppType == CNLiveAppTypeBLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 90 | 92 | [text yy_setTextHighlightRange:NSMakeRange(11, 4) color:color backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { |
| 91 | 93 | [weakSelf.view endEditing:YES]; |
| 92 | 94 | [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementUser]; |
| ... | ... | @@ -124,6 +126,12 @@ |
| 124 | 126 | } |
| 125 | 127 | |
| 126 | 128 | } |
| 129 | +#pragma mark - CNLiveShareManagerDelegate | |
| 130 | +/// 获取对应的client_secret | |
| 131 | +-(NSString *)shareAppleLoginClientSecret | |
| 132 | +{ | |
| 133 | + return [[[NSBundle mainBundle]bundleIdentifier] isEqualToString:@"com.cnlive.CNLiveNetPlusBusiness.debug"]? CNLiveDebugPlusBusinessSecretKey:CNLiveReleasePlusBusinessSecretKey; | |
| 134 | +} | |
| 127 | 135 | |
| 128 | 136 | #pragma mark - CNLiveThreeLoginViewDelegate |
| 129 | 137 | - (void)clickedButton:(CNLiveThreeLoginView *)view type:(CNLiveSendAuthResp)type{ |
| ... | ... | @@ -158,6 +166,8 @@ |
| 158 | 166 | model.location = userInfo.location; |
| 159 | 167 | model.faceUrl = userInfo.faceUrl; |
| 160 | 168 | model.thirdPartyId = userInfo.thirdPartyId; |
| 169 | + model.access_token = userInfo.access_token; | |
| 170 | + model.refresh_token = userInfo.refresh_token; | |
| 161 | 171 | |
| 162 | 172 | model.countryName = self.loginView.countryName; |
| 163 | 173 | model.countryCode = self.loginView.countryCode; |
| ... | ... | @@ -203,6 +213,8 @@ |
| 203 | 213 | @"location":model.location?model.location:@"", |
| 204 | 214 | @"faceUrl":model.faceUrl?model.faceUrl:@"", |
| 205 | 215 | @"uuid":[CNLiveBusinessTools getUidForStat:[NSDate date]], |
| 216 | + @"accessToken":[model.access_token isNotBlank]?model.access_token:@"", | |
| 217 | + @"refreshToken":[model.refresh_token isNotBlank]?model.refresh_token:@"", | |
| 206 | 218 | @"appId":AppId}; |
| 207 | 219 | [CNLiveNetworking setAllowRequestDefaultArgument:YES]; |
| 208 | 220 | [CNLiveNetworking setupShowDataResult:NO]; | ... | ... |
CNLiveBLoginModule/Classes/ThreeLogin/CNLiveBindingTelController.m
| ... | ... | @@ -102,7 +102,7 @@ |
| 102 | 102 | text.yy_color = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0]; |
| 103 | 103 | text.yy_font = [UIFont systemFontOfSize:14.0]; |
| 104 | 104 | __weak typeof(self) weakSelf = self; |
| 105 | - UIColor *color = BusinessLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 105 | + UIColor *color = AppType == CNLiveAppTypeBLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 106 | 106 | [text yy_setTextHighlightRange:NSMakeRange(7, 12) color:color backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { |
| 107 | 107 | __strong typeof(weakSelf) strongSelf = weakSelf; |
| 108 | 108 | if(!strongSelf) return; | ... | ... |
CNLiveBLoginModule/Classes/ThreeLogin/CNLiveBindingTelView.m
| ... | ... | @@ -244,7 +244,7 @@ static const NSInteger timeValue = 1.5; |
| 244 | 244 | [binding setTitle:@"确认手机绑定并同意协议" forState:UIControlStateNormal]; |
| 245 | 245 | [binding setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
| 246 | 246 | binding.titleLabel.font = [UIFont systemFontOfSize:15.0]; |
| 247 | - UIColor *color = BusinessLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 247 | + UIColor *color = AppType == CNLiveAppTypeBLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 248 | 248 | binding.backgroundColor = color; |
| 249 | 249 | binding.layer.cornerRadius = 20; |
| 250 | 250 | binding.layer.masksToBounds = YES; | ... | ... |
CNLiveBLoginModule/Classes/ThreeLogin/CNLiveThreeLoginModel.h
| ... | ... | @@ -40,6 +40,9 @@ NS_ASSUME_NONNULL_BEGIN |
| 40 | 40 | @property (nonatomic, copy) NSString *location; |
| 41 | 41 | @property (nonatomic, copy) NSString *faceUrl; |
| 42 | 42 | |
| 43 | +@property (nonatomic, copy) NSString *access_token; | |
| 44 | +@property (nonatomic, copy) NSString *refresh_token; | |
| 45 | + | |
| 43 | 46 | @property (nonatomic, assign) CNLiveSendAuthResp type; |
| 44 | 47 | |
| 45 | 48 | @end | ... | ... |
CNLiveBLoginModule/Classes/View/CNLiveCompleteInfoView.m
| ... | ... | @@ -84,7 +84,7 @@ static const NSInteger timeValue = 1.5; |
| 84 | 84 | [next setTitle:@"下一步" forState:UIControlStateNormal]; |
| 85 | 85 | [next setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
| 86 | 86 | next.titleLabel.font = [UIFont systemFontOfSize:15.0]; |
| 87 | - UIColor *color = BusinessLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 87 | + UIColor *color = AppType == CNLiveAppTypeBLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 88 | 88 | next.backgroundColor = color; |
| 89 | 89 | next.layer.cornerRadius = 20; |
| 90 | 90 | next.layer.masksToBounds = YES; |
| ... | ... | @@ -213,7 +213,7 @@ static const NSInteger timeValue = 1.5; |
| 213 | 213 | [alertController addAction:cancel]; |
| 214 | 214 | |
| 215 | 215 | NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; |
| 216 | - UIColor *color = BusinessLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 216 | + UIColor *color = AppType == CNLiveAppTypeBLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 217 | 217 | |
| 218 | 218 | titleAttributs[NSForegroundColorAttributeName] = color; |
| 219 | 219 | ... | ... |
CNLiveBLoginModule/Classes/View/CNLiveLoginView.m
| ... | ... | @@ -123,7 +123,7 @@ static const NSInteger timeValue = 1.5; |
| 123 | 123 | [login setTitle:@"手机号登录" forState:UIControlStateNormal]; |
| 124 | 124 | [login setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
| 125 | 125 | login.titleLabel.font = [UIFont systemFontOfSize:15.0]; |
| 126 | - UIColor *color = BusinessLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 126 | + UIColor *color = AppType == CNLiveAppTypeBLive?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0]; | |
| 127 | 127 | login.backgroundColor = color; |
| 128 | 128 | login.layer.cornerRadius = 20; |
| 129 | 129 | login.layer.masksToBounds = YES; |
| ... | ... | @@ -294,7 +294,7 @@ static const NSInteger timeValue = 1.5; |
| 294 | 294 | button.backgroundColor = [UIColor whiteColor]; |
| 295 | 295 | button.userInteractionEnabled = YES; |
| 296 | 296 | [button setTitle:@"" forState:UIControlStateNormal]; |
| 297 | - UIImage *image2 = [self getImageWithImageName:BusinessLive?@"login_get_code_b":@"login_get_code" bundleName:@"CNLiveBLoginModule" targetClass:[self class]]; | |
| 297 | + UIImage *image2 = [self getImageWithImageName:AppType == CNLiveAppTypeBLive?@"login_get_code_b":@"login_get_code" bundleName:@"CNLiveBLoginModule" targetClass:[self class]]; | |
| 298 | 298 | [button setImage:image2 forState:UIControlStateNormal]; |
| 299 | 299 | } |
| 300 | 300 | ... | ... |