Commit cb1a8bd854f2daea9566b8eb3394425990b99d95
1 parent
4a21f062
更改返回数据
Showing
18 changed files
with
107 additions
and
127 deletions
CNLiveUserSystemDemo.xcodeproj/project.xcworkspace/xcuserdata/iOS.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveFeedback.m
| ... | ... | @@ -46,9 +46,16 @@ static NSString *feedbackURL = @"https://api.cnlive.com/open/api2/user/userRepo |
| 46 | 46 | [[CNLiveNetworkManager manager] requestPostURL:feedbackURL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) { |
| 47 | 47 | |
| 48 | 48 | responseObject = [responseObject validatedDictionary]; |
| 49 | - success(responseObject); | |
| 50 | 49 | |
| 51 | - if (![responseObject[@"errorCode"] isEqualToString:@"0"]) { | |
| 50 | + if ([[responseObject allKeys] containsObject:@"errorCode"] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { | |
| 51 | + | |
| 52 | + success(responseObject); | |
| 53 | + | |
| 54 | + } else { | |
| 55 | + | |
| 56 | + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:[responseObject[@"errorCode"] integerValue] userInfo:@{NSLocalizedDescriptionKey : responseObject[@"errorMessage"]}]; | |
| 57 | + failure(error); | |
| 58 | + | |
| 52 | 59 | [CNLiveUserSystemTools errorStat:responseObject[@"errorMessage"]]; |
| 53 | 60 | } |
| 54 | 61 | ... | ... |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveLogin.m
| ... | ... | @@ -110,16 +110,21 @@ static NSString *thirdLoginURL = @"https://api.cnlive.com/open/api2/user/loginI |
| 110 | 110 | [[CNLiveNetworkManager manager] requestPostURL:URL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) { |
| 111 | 111 | |
| 112 | 112 | responseObject = [responseObject validatedDictionary]; |
| 113 | - success(responseObject); | |
| 114 | 113 | |
| 115 | 114 | if ([[responseObject allKeys] containsObject:@"errorCode"] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { |
| 116 | 115 | |
| 116 | + success(responseObject); | |
| 117 | + | |
| 117 | 118 | NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; |
| 118 | 119 | [userDefaults setObject:responseObject[@"data"][@"token"] forKey:@"CNLiveAuthToken"]; |
| 119 | 120 | [userDefaults setObject:responseObject[@"data"][@"uid"] forKey:@"CNLiveUserSid"]; |
| 120 | 121 | [userDefaults synchronize]; |
| 121 | 122 | |
| 122 | 123 | } else { |
| 124 | + | |
| 125 | + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:[responseObject[@"errorCode"] integerValue] userInfo:@{NSLocalizedDescriptionKey : responseObject[@"errorMessage"]}]; | |
| 126 | + failure(error); | |
| 127 | + | |
| 123 | 128 | [CNLiveUserSystemTools errorStat:responseObject[@"errorMessage"]]; |
| 124 | 129 | } |
| 125 | 130 | ... | ... |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveRegister.m
| ... | ... | @@ -50,10 +50,11 @@ static NSString *registerURL = @"https://api.cnlive.com/open/api2/user/register |
| 50 | 50 | [[CNLiveNetworkManager manager] requestPostURL:registerURL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) { |
| 51 | 51 | |
| 52 | 52 | responseObject = [responseObject validatedDictionary]; |
| 53 | - success(responseObject); | |
| 54 | 53 | |
| 55 | 54 | if ([[responseObject allKeys] containsObject:@"errorCode"] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { |
| 56 | 55 | |
| 56 | + success(responseObject); | |
| 57 | + | |
| 57 | 58 | NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; |
| 58 | 59 | [userDefaults setObject:responseObject[@"data"][@"token"] forKey:@"CNLiveAuthToken"]; |
| 59 | 60 | [userDefaults setObject:responseObject[@"data"][@"uid"] forKey:@"CNLiveUserSid"]; |
| ... | ... | @@ -61,6 +62,10 @@ static NSString *registerURL = @"https://api.cnlive.com/open/api2/user/register |
| 61 | 62 | [userDefaults synchronize]; |
| 62 | 63 | |
| 63 | 64 | } else { |
| 65 | + | |
| 66 | + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:[responseObject[@"errorCode"] integerValue] userInfo:@{NSLocalizedDescriptionKey : responseObject[@"errorMessage"]}]; | |
| 67 | + failure(error); | |
| 68 | + | |
| 64 | 69 | [CNLiveUserSystemTools errorStat:responseObject[@"errorMessage"]]; |
| 65 | 70 | } |
| 66 | 71 | ... | ... |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUploadIcon.m
| ... | ... | @@ -66,12 +66,20 @@ static NSString *uploadIconURL = @"https://api.cnlive.com/open/api2/user/update |
| 66 | 66 | [[CNLiveNetworkManager manager] uploadImageWithURL:uploadIconURL parameters:paramters imageData:data success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) { |
| 67 | 67 | |
| 68 | 68 | responseObject = [responseObject validatedDictionary]; |
| 69 | - success(responseObject); | |
| 70 | 69 | |
| 71 | - if (![responseObject[@"errorCode"] isEqualToString:@"0"]) { | |
| 70 | + if ([[responseObject allKeys] containsObject:@"errorCode"] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { | |
| 71 | + | |
| 72 | + success(responseObject); | |
| 73 | + | |
| 74 | + } else { | |
| 75 | + | |
| 76 | + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:[responseObject[@"errorCode"] integerValue] userInfo:@{NSLocalizedDescriptionKey : responseObject[@"errorMessage"]}]; | |
| 77 | + failure(error); | |
| 78 | + | |
| 72 | 79 | [CNLiveUserSystemTools errorStat:responseObject[@"errorMessage"]]; |
| 73 | 80 | } |
| 74 | 81 | |
| 82 | + | |
| 75 | 83 | } failure:^(NSURLResponse * _Nullable response, NSError * _Nullable error) { |
| 76 | 84 | failure(error); |
| 77 | 85 | [CNLiveUserSystemTools errorStat:error.localizedDescription]; | ... | ... |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserInfo.m
| ... | ... | @@ -168,9 +168,16 @@ static NSString *updatePwdURL = @"https://api.cnlive.com/open/api2/user/updateP |
| 168 | 168 | [[CNLiveNetworkManager manager] requestPostURL:URL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) { |
| 169 | 169 | |
| 170 | 170 | responseObject = [responseObject validatedDictionary]; |
| 171 | - success(responseObject); | |
| 172 | - | |
| 173 | - if (![responseObject[@"errorCode"] isEqualToString:@"0"]) { | |
| 171 | + | |
| 172 | + if ([[responseObject allKeys] containsObject:@"errorCode"] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { | |
| 173 | + | |
| 174 | + success(responseObject); | |
| 175 | + | |
| 176 | + } else { | |
| 177 | + | |
| 178 | + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:[responseObject[@"errorCode"] integerValue] userInfo:@{NSLocalizedDescriptionKey : responseObject[@"errorMessage"]}]; | |
| 179 | + failure(error); | |
| 180 | + | |
| 174 | 181 | [CNLiveUserSystemTools errorStat:responseObject[@"errorMessage"]]; |
| 175 | 182 | } |
| 176 | 183 | ... | ... |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveVerificationCode.m
| ... | ... | @@ -50,9 +50,16 @@ static NSString *passwordURL = @"https://api.cnlive.com/open/api2/user/sendVeri |
| 50 | 50 | [[CNLiveNetworkManager manager] requestPostURL:URL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) { |
| 51 | 51 | |
| 52 | 52 | responseObject = [responseObject validatedDictionary]; |
| 53 | - success(responseObject); | |
| 54 | - | |
| 55 | - if (![responseObject[@"errorCode"] isEqualToString:@"0"]) { | |
| 53 | + | |
| 54 | + if ([[responseObject allKeys] containsObject:@"errorCode"] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { | |
| 55 | + | |
| 56 | + success(responseObject); | |
| 57 | + | |
| 58 | + } else { | |
| 59 | + | |
| 60 | + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:[responseObject[@"errorCode"] integerValue] userInfo:@{NSLocalizedDescriptionKey : responseObject[@"errorMessage"]}]; | |
| 61 | + failure(error); | |
| 62 | + | |
| 56 | 63 | [CNLiveUserSystemTools errorStat:responseObject[@"errorMessage"]]; |
| 57 | 64 | } |
| 58 | 65 | ... | ... |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/Common.h
| ... | ... | @@ -11,6 +11,6 @@ |
| 11 | 11 | |
| 12 | 12 | #define kSVer @"4.0" //探针版本 |
| 13 | 13 | #define StatAppVersion ([[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleShortVersionString"]) |
| 14 | -#define SDKVersion @"1.1.0" //SDK版本 | |
| 14 | +#define SDKVersion @"1.1.1" //SDK版本 | |
| 15 | 15 | |
| 16 | 16 | #endif /* Common_h */ | ... | ... |
CNLiveUserSystemDemo/Conreollers/LoginViewController.m
| ... | ... | @@ -57,16 +57,12 @@ |
| 57 | 57 | [CNLiveUserSystemCenter loginWithUserName:_idAndPwdView.idTF.text password:_idAndPwdView.pwdTF.text frmId:nil success:^(id result) { |
| 58 | 58 | |
| 59 | 59 | NSLog(@"登录 success------------%@",result); |
| 60 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 61 | - [Tools setUserLogin:YES]; | |
| 62 | - [SVProgressHUD showSuccessWithStatus:@"登录成功"]; | |
| 63 | - [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 64 | - [self.navigationController popViewControllerAnimated:YES]; | |
| 65 | - | |
| 66 | - } else { | |
| 67 | - [Tools toast:result[@"errorMessage"]]; | |
| 68 | - [SVProgressHUD dismiss]; | |
| 69 | - } | |
| 60 | + | |
| 61 | + [Tools setUserLogin:YES]; | |
| 62 | + [SVProgressHUD showSuccessWithStatus:@"登录成功"]; | |
| 63 | + [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 64 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 65 | + | |
| 70 | 66 | |
| 71 | 67 | } failure:^(NSError *error) { |
| 72 | 68 | ... | ... |
CNLiveUserSystemDemo/Conreollers/ModifyUserInfoViewController.m
| ... | ... | @@ -46,31 +46,22 @@ |
| 46 | 46 | [CNLiveUserSystemCenter updateMobileWithUid:model.uid mobile:_registBasicInformationView.phoneTF.text verificationCode:_registBasicInformationView.verificationTF.text success:^(id result) { |
| 47 | 47 | |
| 48 | 48 | NSLog(@"-----------%@",result); |
| 49 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 50 | - [SVProgressHUD showSuccessWithStatus:@"手机号修改成功"]; | |
| 51 | - [self.navigationController popViewControllerAnimated:YES]; | |
| 52 | - | |
| 53 | - } else { | |
| 54 | - [Tools toast:result[@"errorMessage"]]; | |
| 55 | - [SVProgressHUD dismiss]; | |
| 56 | - } | |
| 57 | 49 | |
| 50 | + [SVProgressHUD showSuccessWithStatus:@"手机号修改成功"]; | |
| 51 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 52 | + | |
| 58 | 53 | } failure:^(NSError *error) { |
| 59 | 54 | [Tools toast:error.localizedDescription]; |
| 60 | 55 | [SVProgressHUD dismiss]; |
| 61 | 56 | }]; |
| 57 | + | |
| 62 | 58 | } else { |
| 63 | 59 | [CNLiveUserSystemCenter modifyUserInfoType:_modifyType uid:model.uid modifyInfo:_textField1.text success:^(id result) { |
| 64 | 60 | |
| 65 | 61 | NSLog(@"-----------%@",result); |
| 66 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 67 | - [SVProgressHUD showSuccessWithStatus:@"修改成功"]; | |
| 68 | - [self.navigationController popViewControllerAnimated:YES]; | |
| 69 | - | |
| 70 | - } else { | |
| 71 | - [Tools toast:result[@"errorMessage"]]; | |
| 72 | - [SVProgressHUD dismiss]; | |
| 73 | - } | |
| 62 | + | |
| 63 | + [SVProgressHUD showSuccessWithStatus:@"修改成功"]; | |
| 64 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 74 | 65 | |
| 75 | 66 | } failure:^(NSError *error) { |
| 76 | 67 | [Tools toast:error.localizedDescription]; |
| ... | ... | @@ -78,7 +69,6 @@ |
| 78 | 69 | |
| 79 | 70 | }]; |
| 80 | 71 | } |
| 81 | - | |
| 82 | 72 | } |
| 83 | 73 | |
| 84 | 74 | - (void)verificationBtnAction |
| ... | ... | @@ -89,7 +79,6 @@ |
| 89 | 79 | |
| 90 | 80 | [Tools toast:result[@"errorMessage"]]; |
| 91 | 81 | |
| 92 | - | |
| 93 | 82 | } failure:^(NSError *error) { |
| 94 | 83 | [Tools toast:error.localizedDescription]; |
| 95 | 84 | }]; | ... | ... |
CNLiveUserSystemDemo/Conreollers/RegisterViewController.m
| ... | ... | @@ -87,18 +87,11 @@ |
| 87 | 87 | |
| 88 | 88 | [CNLiveUserSystemCenter registerWithUserName:_registBasicInformationView.phoneTF.text password:_registBasicInformationView.setPwdTF.text verificationCode:_registBasicInformationView.verificationTF.text invitationCode:nil frmId:nil success:^(id result) { |
| 89 | 89 | |
| 90 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 91 | - [Tools setUserLogin:YES]; | |
| 92 | - [SVProgressHUD showSuccessWithStatus:@"成功"]; | |
| 93 | - [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 94 | - [self.navigationController popToRootViewControllerAnimated:YES]; | |
| 95 | - | |
| 96 | - } else { | |
| 97 | - [Tools toast:result[@"errorMessage"]]; | |
| 98 | - [SVProgressHUD dismiss]; | |
| 90 | + [Tools setUserLogin:YES]; | |
| 91 | + [SVProgressHUD showSuccessWithStatus:@"成功"]; | |
| 92 | + [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 93 | + [self.navigationController popToRootViewControllerAnimated:YES]; | |
| 99 | 94 | |
| 100 | - } | |
| 101 | - | |
| 102 | 95 | } failure:^(NSError *error) { |
| 103 | 96 | |
| 104 | 97 | [Tools toast:error.localizedDescription]; |
| ... | ... | @@ -110,17 +103,11 @@ |
| 110 | 103 | |
| 111 | 104 | [CNLiveUserSystemCenter shortcutLoginWithUserName:_registBasicInformationView.phoneTF.text verificationCode:_registBasicInformationView.verificationTF.text frmId:nil success:^(id result) { |
| 112 | 105 | |
| 113 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 114 | - [Tools setUserLogin:YES]; | |
| 115 | - [SVProgressHUD showSuccessWithStatus:@"成功"]; | |
| 116 | - [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 117 | - [self.navigationController popToRootViewControllerAnimated:YES]; | |
| 118 | - | |
| 119 | - } else { | |
| 120 | - [Tools toast:result[@"errorMessage"]]; | |
| 121 | - [SVProgressHUD dismiss]; | |
| 122 | - } | |
| 123 | - | |
| 106 | + [Tools setUserLogin:YES]; | |
| 107 | + [SVProgressHUD showSuccessWithStatus:@"成功"]; | |
| 108 | + [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 109 | + [self.navigationController popToRootViewControllerAnimated:YES]; | |
| 110 | + | |
| 124 | 111 | } failure:^(NSError *error) { |
| 125 | 112 | |
| 126 | 113 | [Tools toast:error.localizedDescription]; |
| ... | ... | @@ -130,14 +117,10 @@ |
| 130 | 117 | |
| 131 | 118 | } else { |
| 132 | 119 | [CNLiveUserSystemCenter changePasswordWithMobile:_registBasicInformationView.phoneTF.text verificationCode:_registBasicInformationView.verificationTF.text newPassword:_registBasicInformationView.setPwdTF.text success:^(id result) { |
| 133 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 134 | - [SVProgressHUD showSuccessWithStatus:@"密码修改成功"]; | |
| 135 | - [self.navigationController popToRootViewControllerAnimated:YES]; | |
| 136 | - | |
| 137 | - } else { | |
| 138 | - [Tools toast:result[@"errorMessage"]]; | |
| 139 | - [SVProgressHUD dismiss]; | |
| 140 | - } | |
| 120 | + | |
| 121 | + [SVProgressHUD showSuccessWithStatus:@"密码修改成功"]; | |
| 122 | + [self.navigationController popToRootViewControllerAnimated:YES]; | |
| 123 | + | |
| 141 | 124 | } failure:^(NSError *error) { |
| 142 | 125 | [Tools toast:error.localizedDescription]; |
| 143 | 126 | [SVProgressHUD dismiss]; | ... | ... |
CNLiveUserSystemDemo/Conreollers/UserInfoViewController.m
| ... | ... | @@ -191,13 +191,7 @@ |
| 191 | 191 | [CNLiveUserSystemCenter modifyUserInfoType:UserInfoTypeGender uid:model.uid modifyInfo:string success:^(id result) { |
| 192 | 192 | |
| 193 | 193 | NSLog(@"%@",result); |
| 194 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 195 | - [SVProgressHUD showSuccessWithStatus:@"修改成功"]; | |
| 196 | - | |
| 197 | - } else { | |
| 198 | - [Tools toast:result[@"errorMessage"]]; | |
| 199 | - [SVProgressHUD dismiss]; | |
| 200 | - } | |
| 194 | + [SVProgressHUD showSuccessWithStatus:@"修改成功"]; | |
| 201 | 195 | |
| 202 | 196 | } failure:^(NSError *error) { |
| 203 | 197 | [Tools toast:error.localizedDescription]; | ... | ... |
CNLiveUserSystemDemo/Conreollers/ViewController.m
| ... | ... | @@ -129,14 +129,8 @@ |
| 129 | 129 | |
| 130 | 130 | NSLog(@"--------%@",result); |
| 131 | 131 | |
| 132 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 133 | - [SVProgressHUD showSuccessWithStatus:@"更新附加信息成功"]; | |
| 134 | - [self.navigationController popViewControllerAnimated:YES]; | |
| 135 | - | |
| 136 | - } else { | |
| 137 | - [Tools toast:result[@"errorMessage"]]; | |
| 138 | - [SVProgressHUD dismiss]; | |
| 139 | - } | |
| 132 | + [SVProgressHUD showSuccessWithStatus:@"更新附加信息成功"]; | |
| 133 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 140 | 134 | |
| 141 | 135 | } failure:^(NSError *error) { |
| 142 | 136 | [Tools toast:error.localizedDescription]; |
| ... | ... | @@ -154,18 +148,15 @@ |
| 154 | 148 | |
| 155 | 149 | [CNLiveUserSystemCenter queryUserInfoWithUid:model.uid srcUid:model.uid success:^(id result) { |
| 156 | 150 | NSLog(@"%@",result); |
| 157 | - if ([result[@"errorCode"] isEqualToString:@"0"]) { | |
| 158 | - NSDictionary *dic = result[@"data"]; | |
| 159 | - NSString *message = [NSString stringWithFormat:@" uid:%@\n nickName:%@\n gender:%@\n location:%@\n extInfo:%@\n mobile:%@\n email:%@",dic[@"uid"],dic[@"nickName"],dic[@"gender"],dic[@"location"],dic[@"extInfo"],dic[@"mobile"],dic[@"email"]]; | |
| 160 | - NSString *icon = dic[@"faceUrl"]; | |
| 161 | - | |
| 162 | - [UserInfoSava setLocalUserInfo:icon withKey:@"faceUrl"]; | |
| 163 | - [_tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationFade]; | |
| 164 | - [Tools toast:message]; | |
| 165 | - }else { | |
| 166 | - [Tools toast:result[@"errorMessage"]]; | |
| 167 | - } | |
| 168 | - | |
| 151 | + | |
| 152 | + NSDictionary *dic = result[@"data"]; | |
| 153 | + NSString *message = [NSString stringWithFormat:@" uid:%@\n nickName:%@\n gender:%@\n location:%@\n extInfo:%@\n mobile:%@\n email:%@",dic[@"uid"],dic[@"nickName"],dic[@"gender"],dic[@"location"],dic[@"extInfo"],dic[@"mobile"],dic[@"email"]]; | |
| 154 | + NSString *icon = dic[@"faceUrl"]; | |
| 155 | + | |
| 156 | + [UserInfoSava setLocalUserInfo:icon withKey:@"faceUrl"]; | |
| 157 | + [_tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationFade]; | |
| 158 | + [Tools toast:message]; | |
| 159 | + | |
| 169 | 160 | } failure:^(NSError *error) { |
| 170 | 161 | [Tools toast:error.localizedDescription]; |
| 171 | 162 | }]; | ... | ... |
CNLiveUserSystemDemo/Tools/CNLiveThirdLoginManager.m
| ... | ... | @@ -123,15 +123,11 @@ |
| 123 | 123 | [CNLiveUserSystemCenter thirdPartyLoginWithThirdPartyPlatType:@"2" thirdPartyId:[tencentOAuth getUserOpenID] nickName:[result objectForKey:@"nickname"] gender:gender location:[result objectForKey:@"city"] faceUrl:[result objectForKey:@"figureurl"] frmId:nil success:^(id result) { |
| 124 | 124 | NSLog(@"qq登录------%@",result); |
| 125 | 125 | |
| 126 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 127 | - [Tools setUserLogin:YES]; | |
| 128 | - [SVProgressHUD showSuccessWithStatus:@"登录成功"]; | |
| 129 | - [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 130 | - [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginSuccess object:nil userInfo:nil]; | |
| 131 | - | |
| 132 | - } else { | |
| 133 | - [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginFailure object:nil userInfo:nil]; | |
| 134 | - } | |
| 126 | + [Tools setUserLogin:YES]; | |
| 127 | + [SVProgressHUD showSuccessWithStatus:@"登录成功"]; | |
| 128 | + [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 129 | + [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginSuccess object:nil userInfo:nil]; | |
| 130 | + | |
| 135 | 131 | } failure:^(NSError *error) { |
| 136 | 132 | [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginFailure object:nil userInfo:nil]; |
| 137 | 133 | }]; |
| ... | ... | @@ -251,15 +247,11 @@ |
| 251 | 247 | [CNLiveUserSystemCenter thirdPartyLoginWithThirdPartyPlatType:@"3" thirdPartyId:[dic objectForKey:@"openid"] nickName:[dic objectForKey:@"nickname"] gender:gender location:[dic objectForKey:@"country"] faceUrl:[dic objectForKey:@"headimgurl"] frmId:nil success:^(id result) { |
| 252 | 248 | NSLog(@"微信登录------%@",result); |
| 253 | 249 | |
| 254 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 255 | - [Tools setUserLogin:YES]; | |
| 256 | - [SVProgressHUD showSuccessWithStatus:@"登录成功"]; | |
| 257 | - [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 258 | - [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginSuccess object:nil userInfo:nil]; | |
| 259 | - | |
| 260 | - } else { | |
| 261 | - [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginFailure object:nil userInfo:nil]; | |
| 262 | - } | |
| 250 | + [Tools setUserLogin:YES]; | |
| 251 | + [SVProgressHUD showSuccessWithStatus:@"登录成功"]; | |
| 252 | + [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 253 | + [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginSuccess object:nil userInfo:nil]; | |
| 254 | + | |
| 263 | 255 | } failure:^(NSError *error) { |
| 264 | 256 | [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginFailure object:nil userInfo:nil]; |
| 265 | 257 | }]; |
| ... | ... | @@ -311,15 +303,11 @@ |
| 311 | 303 | [CNLiveUserSystemCenter thirdPartyLoginWithThirdPartyPlatType:@"1" thirdPartyId:[dic objectForKey:@"id"] nickName:[dic objectForKey:@"name"] gender:gender location:[dic objectForKey:@"location"] faceUrl:[dic objectForKey:@"avatar_hd"] frmId:nil success:^(id result) { |
| 312 | 304 | NSLog(@"微博登录------%@",result); |
| 313 | 305 | |
| 314 | - if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | |
| 315 | - [Tools setUserLogin:YES]; | |
| 316 | - [SVProgressHUD showSuccessWithStatus:@"登录成功"]; | |
| 317 | - [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 318 | - [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginSuccess object:nil userInfo:nil]; | |
| 319 | - | |
| 320 | - } else { | |
| 321 | - [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginFailure object:nil userInfo:nil]; | |
| 322 | - } | |
| 306 | + [Tools setUserLogin:YES]; | |
| 307 | + [SVProgressHUD showSuccessWithStatus:@"登录成功"]; | |
| 308 | + [UserInfoSava saveUserinfoDic:result[@"data"]]; | |
| 309 | + [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginSuccess object:nil userInfo:nil]; | |
| 310 | + | |
| 323 | 311 | } failure:^(NSError *error) { |
| 324 | 312 | [[NSNotificationCenter defaultCenter] postNotificationName:ThirdLoginFailure object:nil userInfo:nil]; |
| 325 | 313 | }]; | ... | ... |
CNLiveUserSystemSDK.xcodeproj/project.xcworkspace/xcuserdata/iOS.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
CNLiveUserSystemSDK/Info.plist
| ... | ... | @@ -15,9 +15,9 @@ |
| 15 | 15 | <key>CFBundlePackageType</key> |
| 16 | 16 | <string>FMWK</string> |
| 17 | 17 | <key>CFBundleShortVersionString</key> |
| 18 | - <string>1.0</string> | |
| 18 | + <string>1.1.1</string> | |
| 19 | 19 | <key>CFBundleVersion</key> |
| 20 | - <string>$(CURRENT_PROJECT_VERSION)</string> | |
| 20 | + <string>1.1.1.110113</string> | |
| 21 | 21 | <key>NSPrincipalClass</key> |
| 22 | 22 | <string></string> |
| 23 | 23 | </dict> | ... | ... |
Products/CNLiveUserSystemSDK.framework/CNLiveUserSystemSDK
No preview for this file type
Products/CNLiveUserSystemSDK.framework/Info.plist
No preview for this file type