Commit 4bd7aa4e825ab27bc15805f000d7347ed827492d
1 parent
d47606c8
token处理
Showing
7 changed files
with
67 additions
and
55 deletions
CNLiveUserSystemDemo.xcodeproj/project.xcworkspace/xcuserdata/iOS.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveLogin.m
| @@ -110,6 +110,14 @@ static NSString *thirdLoginURL = @"http://api.cnlive.com/open/api2/user/loginIn | @@ -110,6 +110,14 @@ static NSString *thirdLoginURL = @"http://api.cnlive.com/open/api2/user/loginIn | ||
| 110 | [[CNLiveNetworkManager manager] requestPostURL:URL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) { | 110 | [[CNLiveNetworkManager manager] requestPostURL:URL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) { |
| 111 | 111 | ||
| 112 | responseObject = [responseObject validatedDictionary]; | 112 | responseObject = [responseObject validatedDictionary]; |
| 113 | + | ||
| 114 | + if ([[responseObject allKeys] containsObject:@"errorCode"] && [responseObject[@"errorCode"] isEqualToString:@"0"]) { | ||
| 115 | + | ||
| 116 | + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; | ||
| 117 | + [userDefaults setObject:responseObject[@"data"][@"token"] forKey:@"CNLiveAuthToken"]; | ||
| 118 | + [userDefaults synchronize]; | ||
| 119 | + | ||
| 120 | + } | ||
| 113 | success(responseObject); | 121 | success(responseObject); |
| 114 | 122 | ||
| 115 | } failure:^(NSURLResponse * _Nullable response, NSError * _Nullable error) { | 123 | } failure:^(NSURLResponse * _Nullable response, NSError * _Nullable error) { |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserSystemCenter.h
| @@ -16,7 +16,8 @@ | @@ -16,7 +16,8 @@ | ||
| 16 | @abstract 配置appId,appKey | 16 | @abstract 配置appId,appKey |
| 17 | @param appId 应用ID | 17 | @param appId 应用ID |
| 18 | @param appKey 注册后的应用key | 18 | @param appKey 注册后的应用key |
| 19 | - @warning 必传参数,AppDelegate中调用 | 19 | + @warning 必传参数 |
| 20 | + 必须在 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; 方法中调用 | ||
| 20 | */ | 21 | */ |
| 21 | + (void)setAppId:(NSString *)appId appKey:(NSString *)appKey appSecret:(NSString *)appSecret; | 22 | + (void)setAppId:(NSString *)appId appKey:(NSString *)appKey appSecret:(NSString *)appSecret; |
| 22 | 23 | ||
| @@ -27,8 +28,8 @@ | @@ -27,8 +28,8 @@ | ||
| 27 | @param verificationCode 手机验证码(手机号注册时必填) | 28 | @param verificationCode 手机验证码(手机号注册时必填) |
| 28 | @param invitationCode 邀请码(非必填) | 29 | @param invitationCode 邀请码(非必填) |
| 29 | @param frmId 渠道ID(非必填) | 30 | @param frmId 渠道ID(非必填) |
| 30 | - @param success 注册成功回调 | ||
| 31 | - @param failure 注册失败回调 | 31 | + @param success 成功回调 |
| 32 | + @param failure 失败回调 | ||
| 32 | */ | 33 | */ |
| 33 | + (void)registerWithUserName:(NSString *)userName password:(NSString *)password verificationCode:(NSString *)verificationCode invitationCode:(NSString *)invitationCode frmId:(NSString *)frmId success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 34 | + (void)registerWithUserName:(NSString *)userName password:(NSString *)password verificationCode:(NSString *)verificationCode invitationCode:(NSString *)invitationCode frmId:(NSString *)frmId success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 34 | 35 | ||
| @@ -41,8 +42,8 @@ | @@ -41,8 +42,8 @@ | ||
| 41 | @param location 用户所在地(非必填) | 42 | @param location 用户所在地(非必填) |
| 42 | @param faceUrl 头像,约100*100(非必填) | 43 | @param faceUrl 头像,约100*100(非必填) |
| 43 | @param frmId 渠道ID(非必填) | 44 | @param frmId 渠道ID(非必填) |
| 44 | - @param success 第三方登录成功回调 | ||
| 45 | - @param failure 第三方登录失败回调 | 45 | + @param success 成功回调 |
| 46 | + @param failure 失败回调 | ||
| 46 | */ | 47 | */ |
| 47 | + (void)thirdPartyLoginWithThirdPartyPlatType:(NSString *)plat thirdPartyId:(NSString *)thirdPartyId nickName:(NSString *)nickName gender:(NSString *)gender location:(NSString *)location faceUrl:(NSString *)faceUrl frmId:(NSString *)frmId success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 48 | + (void)thirdPartyLoginWithThirdPartyPlatType:(NSString *)plat thirdPartyId:(NSString *)thirdPartyId nickName:(NSString *)nickName gender:(NSString *)gender location:(NSString *)location faceUrl:(NSString *)faceUrl frmId:(NSString *)frmId success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 48 | 49 | ||
| @@ -51,8 +52,8 @@ | @@ -51,8 +52,8 @@ | ||
| 51 | @param userName 手机号 | 52 | @param userName 手机号 |
| 52 | @param verificationCode 验证码 | 53 | @param verificationCode 验证码 |
| 53 | @param frmId 渠道ID(非必填) | 54 | @param frmId 渠道ID(非必填) |
| 54 | - @param success 快捷登录成功回调 | ||
| 55 | - @param failure 快捷登录失败回调 | 55 | + @param success 成功回调 |
| 56 | + @param failure 失败回调 | ||
| 56 | */ | 57 | */ |
| 57 | + (void)shortcutLoginWithUserName:(NSString *)userName verificationCode:(NSString *)verificationCode frmId:(NSString *)frmId success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 58 | + (void)shortcutLoginWithUserName:(NSString *)userName verificationCode:(NSString *)verificationCode frmId:(NSString *)frmId success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 58 | 59 | ||
| @@ -61,8 +62,8 @@ | @@ -61,8 +62,8 @@ | ||
| 61 | @param userName 手机号或邮箱 | 62 | @param userName 手机号或邮箱 |
| 62 | @param password 密码 | 63 | @param password 密码 |
| 63 | @param frmId 渠道ID(非必填) | 64 | @param frmId 渠道ID(非必填) |
| 64 | - @param success 登录成功回调 | ||
| 65 | - @param failure 登录失败回调 | 65 | + @param success 成功回调 |
| 66 | + @param failure 失败回调 | ||
| 66 | */ | 67 | */ |
| 67 | + (void)loginWithUserName:(NSString *)userName password:(NSString *)password frmId:(NSString *)frmId success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 68 | + (void)loginWithUserName:(NSString *)userName password:(NSString *)password frmId:(NSString *)frmId success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 68 | 69 | ||
| @@ -70,9 +71,8 @@ | @@ -70,9 +71,8 @@ | ||
| 70 | @abstract 发送验证码 | 71 | @abstract 发送验证码 |
| 71 | @param mobile 手机号 | 72 | @param mobile 手机号 |
| 72 | @param type 发送验证码类型(详见VerificationCodeType) | 73 | @param type 发送验证码类型(详见VerificationCodeType) |
| 73 | - @param success 发送验证码成功回调 | ||
| 74 | - @param failure 发送验证码失败回调 | ||
| 75 | - | 74 | + @param success 成功回调 |
| 75 | + @param failure 失败回调 | ||
| 76 | */ | 76 | */ |
| 77 | + (void)verificationCodeType:(VerificationCodeType)type mobile:(NSString *)mobile success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 77 | + (void)verificationCodeType:(VerificationCodeType)type mobile:(NSString *)mobile success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 78 | 78 | ||
| @@ -80,70 +80,63 @@ | @@ -80,70 +80,63 @@ | ||
| 80 | @abstract 更新用户附加信息 | 80 | @abstract 更新用户附加信息 |
| 81 | @param uid 用户ID | 81 | @param uid 用户ID |
| 82 | @param extInfo 扩展信息(格式由对方自己组织,平台只负责存储和原样读取,NSString类型) | 82 | @param extInfo 扩展信息(格式由对方自己组织,平台只负责存储和原样读取,NSString类型) |
| 83 | - @param token 平台token(登录成功返回token) | ||
| 84 | - @param success 更新用户附加信息成功回调 | ||
| 85 | - @param failure 更新用户附加信息失败回调 | 83 | + @param success 成功回调 |
| 84 | + @param failure 失败回调 | ||
| 86 | */ | 85 | */ |
| 87 | -+ (void)updateOtherInfoWithUid:(NSString *)uid extInfo:(NSString *)extInfo token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 86 | ++ (void)updateOtherInfoWithUid:(NSString *)uid extInfo:(NSString *)extInfo success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 88 | 87 | ||
| 89 | /** | 88 | /** |
| 90 | @abstract 修改用户单项信息 | 89 | @abstract 修改用户单项信息 |
| 91 | @param type 修改类型(nickName-昵称,gender-性别,email-邮箱, location-联系方式) | 90 | @param type 修改类型(nickName-昵称,gender-性别,email-邮箱, location-联系方式) |
| 92 | @param uid 用户ID | 91 | @param uid 用户ID |
| 93 | @param info 对应的信息(注gender对应f/m) | 92 | @param info 对应的信息(注gender对应f/m) |
| 94 | - @param token 平台token(登录成功返回token) | ||
| 95 | - @param success 修改用户单项信息成功回调 | ||
| 96 | - @param failure 修改用户单项信息失败回调 | ||
| 97 | - | 93 | + @param success 成功回调 |
| 94 | + @param failure 失败回调 | ||
| 98 | */ | 95 | */ |
| 99 | -+ (void)modifyUserInfoType:(UserInfoType)type uid:(NSString *)uid modifyInfo:(NSString *)info token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 96 | ++ (void)modifyUserInfoType:(UserInfoType)type uid:(NSString *)uid modifyInfo:(NSString *)info success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 100 | 97 | ||
| 101 | /** | 98 | /** |
| 102 | @abstract 更新手机号 | 99 | @abstract 更新手机号 |
| 103 | @param uid 用户ID | 100 | @param uid 用户ID |
| 104 | @param mobile 手机号 | 101 | @param mobile 手机号 |
| 105 | @param verificationCode 验证码 | 102 | @param verificationCode 验证码 |
| 106 | - @param token 平台token(登录成功返回token) | ||
| 107 | - @param success 更新手机号成功回调 | ||
| 108 | - @param failure 更新手机号失败回调 | ||
| 109 | - | 103 | + @param success 成功回调 |
| 104 | + @param failure 失败回调 | ||
| 110 | */ | 105 | */ |
| 111 | -+ (void)updateMobileWithUid:(NSString *)uid mobile:(NSString *)mobile verificationCode:(NSString *)verificationCode token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 106 | ++ (void)updateMobileWithUid:(NSString *)uid mobile:(NSString *)mobile verificationCode:(NSString *)verificationCode success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 112 | 107 | ||
| 113 | /** | 108 | /** |
| 114 | @abstract 修改密码(通过手机号修改) | 109 | @abstract 修改密码(通过手机号修改) |
| 115 | @param mobile 手机号 | 110 | @param mobile 手机号 |
| 116 | @param verificationCode 验证码 | 111 | @param verificationCode 验证码 |
| 117 | @param newPassword 用户昵称 | 112 | @param newPassword 用户昵称 |
| 118 | - @param success 修改密码成功回调 | ||
| 119 | - @param failure 修改密码失败回调 | ||
| 120 | - | 113 | + @param success 成功回调 |
| 114 | + @param failure 失败回调 | ||
| 121 | */ | 115 | */ |
| 122 | + (void)changePasswordWithMobile:(NSString *)mobile verificationCode:(NSString *)verificationCode newPassword:(NSString *)newPassword success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 116 | + (void)changePasswordWithMobile:(NSString *)mobile verificationCode:(NSString *)verificationCode newPassword:(NSString *)newPassword success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 123 | 117 | ||
| 124 | - | ||
| 125 | /** | 118 | /** |
| 126 | - * 上传头像 | 119 | + @abstract 上传头像 |
| 120 | + @param uid 用户ID | ||
| 121 | + @param icon 头像 | ||
| 127 | */ | 122 | */ |
| 128 | -+ (void)uploadIconWithUid:(NSString *)uid token:(NSString *)token icon:(UIImage *)icon success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 123 | ++ (void)uploadIconWithUid:(NSString *)uid icon:(UIImage *)icon success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 129 | 124 | ||
| 130 | /** | 125 | /** |
| 131 | @abstract 查询用户信息 | 126 | @abstract 查询用户信息 |
| 132 | @param uid 用户ID | 127 | @param uid 用户ID |
| 133 | @param srcUid 被查询用户ID | 128 | @param srcUid 被查询用户ID |
| 134 | - @param token 平台token(登录成功返回token) | ||
| 135 | - @param success 查询用户信息成功回调 | ||
| 136 | - @param failure 查询用户信息失败回调 | 129 | + @param success 成功回调 |
| 130 | + @param failure 失败回调 | ||
| 137 | */ | 131 | */ |
| 138 | -+ (void)queryUserInfoWithUid:(NSString *)uid srcUid:(NSString *)srcUid token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 132 | ++ (void)queryUserInfoWithUid:(NSString *)uid srcUid:(NSString *)srcUid success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 139 | 133 | ||
| 140 | /** | 134 | /** |
| 141 | @abstract 用户反馈 | 135 | @abstract 用户反馈 |
| 142 | @param contentId 举报内容ID | 136 | @param contentId 举报内容ID |
| 143 | @param message 举报内容(app自己组织-不能带特殊字符&号等) | 137 | @param message 举报内容(app自己组织-不能带特殊字符&号等) |
| 144 | - @param success 用户反馈成功回调 | ||
| 145 | - @param failure 用户反馈失败回调 | ||
| 146 | - | 138 | + @param success 成功回调 |
| 139 | + @param failure 失败回调 | ||
| 147 | */ | 140 | */ |
| 148 | + (void)feedbackWithContentId:(NSString *)contentId message:(NSString *)message success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; | 141 | + (void)feedbackWithContentId:(NSString *)contentId message:(NSString *)message success:(void (^)(id result))success failure :(void (^)(NSError *error))failure; |
| 149 | 142 |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserSystemCenter.m
| @@ -81,31 +81,31 @@ | @@ -81,31 +81,31 @@ | ||
| 81 | /** | 81 | /** |
| 82 | * 更新用户附加信息 | 82 | * 更新用户附加信息 |
| 83 | */ | 83 | */ |
| 84 | -+ (void)updateOtherInfoWithUid:(NSString *)uid extInfo:(NSString *)extInfo token:(NSString *)token success:(void (^)(id result))success failure:(void (^)(NSError *))failure | 84 | ++ (void)updateOtherInfoWithUid:(NSString *)uid extInfo:(NSString *)extInfo success:(void (^)(id result))success failure:(void (^)(NSError *))failure |
| 85 | { | 85 | { |
| 86 | CNLiveUserInfo *updateOtherInfo = [[CNLiveUserInfo alloc] init]; | 86 | CNLiveUserInfo *updateOtherInfo = [[CNLiveUserInfo alloc] init]; |
| 87 | 87 | ||
| 88 | - [updateOtherInfo updateOtherInfoWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey uid:uid extInfo:extInfo token:token success:success failure:failure]; | 88 | + [updateOtherInfo updateOtherInfoWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey uid:uid extInfo:extInfo token:[[self class] getToken] success:success failure:failure]; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | /** | 91 | /** |
| 92 | * 修改用户单项信息 | 92 | * 修改用户单项信息 |
| 93 | */ | 93 | */ |
| 94 | -+ (void)modifyUserInfoType:(UserInfoType)type uid:(NSString *)uid modifyInfo:(NSString *)info token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSError *error))failure | 94 | ++ (void)modifyUserInfoType:(UserInfoType)type uid:(NSString *)uid modifyInfo:(NSString *)info success:(void (^)(id result))success failure :(void (^)(NSError *error))failure |
| 95 | { | 95 | { |
| 96 | CNLiveUserInfo *updateUserInfo = [[CNLiveUserInfo alloc] init]; | 96 | CNLiveUserInfo *updateUserInfo = [[CNLiveUserInfo alloc] init]; |
| 97 | 97 | ||
| 98 | - [updateUserInfo modifyUserInfoWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey type:type uid:uid modifyInfo:info token:token success:success failure:failure]; | 98 | + [updateUserInfo modifyUserInfoWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey type:type uid:uid modifyInfo:info token:[[self class] getToken] success:success failure:failure]; |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | /** | 101 | /** |
| 102 | * 更新手机号 | 102 | * 更新手机号 |
| 103 | */ | 103 | */ |
| 104 | -+ (void)updateMobileWithUid:(NSString *)uid mobile:(NSString *)mobile verificationCode:(NSString *)verificationCode token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSError *error))failure | 104 | ++ (void)updateMobileWithUid:(NSString *)uid mobile:(NSString *)mobile verificationCode:(NSString *)verificationCode success:(void (^)(id result))success failure :(void (^)(NSError *error))failure |
| 105 | { | 105 | { |
| 106 | CNLiveUserInfo *updateMobile = [[CNLiveUserInfo alloc] init]; | 106 | CNLiveUserInfo *updateMobile = [[CNLiveUserInfo alloc] init]; |
| 107 | 107 | ||
| 108 | - [updateMobile updateMobileWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey uid:uid mobile:mobile verificationCode:verificationCode token:token success:success failure:failure]; | 108 | + [updateMobile updateMobileWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey uid:uid mobile:mobile verificationCode:verificationCode token:[[self class] getToken] success:success failure:failure]; |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | /** | 111 | /** |
| @@ -122,20 +122,20 @@ | @@ -122,20 +122,20 @@ | ||
| 122 | /** | 122 | /** |
| 123 | * 上传头像 | 123 | * 上传头像 |
| 124 | */ | 124 | */ |
| 125 | -+ (void)uploadIconWithUid:(NSString *)uid token:(NSString *)token icon:(UIImage *)icon success:(void (^)(id))success failure:(void (^)(NSError *))failure | 125 | ++ (void)uploadIconWithUid:(NSString *)uid icon:(UIImage *)icon success:(void (^)(id))success failure:(void (^)(NSError *))failure |
| 126 | { | 126 | { |
| 127 | CNLiveUploadIcon *uplodIcon = [[CNLiveUploadIcon alloc] init]; | 127 | CNLiveUploadIcon *uplodIcon = [[CNLiveUploadIcon alloc] init]; |
| 128 | - [uplodIcon uploadIconWithAppId:[CNLiveUserManager manager].appId uid:uid icon:icon token:token secret:[CNLiveUserManager manager].appSecret success:success failure:failure]; | 128 | + [uplodIcon uploadIconWithAppId:[CNLiveUserManager manager].appId uid:uid icon:icon token:[[self class] getToken] secret:[CNLiveUserManager manager].appSecret success:success failure:failure]; |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | /** | 131 | /** |
| 132 | * 查询用户信息 | 132 | * 查询用户信息 |
| 133 | */ | 133 | */ |
| 134 | -+ (void)queryUserInfoWithUid:(NSString *)uid srcUid:(NSString *)srcUid token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSError *error))failure | 134 | ++ (void)queryUserInfoWithUid:(NSString *)uid srcUid:(NSString *)srcUid success:(void (^)(id result))success failure :(void (^)(NSError *error))failure |
| 135 | { | 135 | { |
| 136 | CNLiveUserInfo *userInfo = [[CNLiveUserInfo alloc] init]; | 136 | CNLiveUserInfo *userInfo = [[CNLiveUserInfo alloc] init]; |
| 137 | 137 | ||
| 138 | - [userInfo queryUserInfoWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey uid:uid srcUid:srcUid token:token success:success failure:failure]; | 138 | + [userInfo queryUserInfoWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey uid:uid srcUid:srcUid token:[[self class] getToken] success:success failure:failure]; |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | /** | 141 | /** |
| @@ -148,4 +148,15 @@ | @@ -148,4 +148,15 @@ | ||
| 148 | [feedback feedbackWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey contentId:contentId message:message success:success failure:failure]; | 148 | [feedback feedbackWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey contentId:contentId message:message success:success failure:failure]; |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | +#pragma mark - token | ||
| 152 | + | ||
| 153 | ++ (NSString *)getToken | ||
| 154 | +{ | ||
| 155 | + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; | ||
| 156 | + if ([userDefaults objectForKey:@"CNLiveAuthToken"]) { | ||
| 157 | + return [userDefaults objectForKey:@"CNLiveAuthToken"]; | ||
| 158 | + } | ||
| 159 | + return @""; | ||
| 160 | +} | ||
| 161 | + | ||
| 151 | @end | 162 | @end |
CNLiveUserSystemDemo/Conreollers/ModifyUserInfoViewController.m
| @@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
| 43 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; | 43 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; |
| 44 | 44 | ||
| 45 | if ([self.title isEqualToString:@"更新手机号"]) { | 45 | if ([self.title isEqualToString:@"更新手机号"]) { |
| 46 | - [CNLiveUserSystemCenter updateMobileWithUid:model.uid mobile:_registBasicInformationView.phoneTF.text verificationCode:_registBasicInformationView.verificationTF.text token:model.token success:^(id result) { | 46 | + [CNLiveUserSystemCenter updateMobileWithUid:model.uid mobile:_registBasicInformationView.phoneTF.text verificationCode:_registBasicInformationView.verificationTF.text success:^(id result) { |
| 47 | 47 | ||
| 48 | NSLog(@"-----------%@",result); | 48 | NSLog(@"-----------%@",result); |
| 49 | if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | 49 | if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { |
| @@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
| 58 | [Tools toast:error.localizedDescription]; | 58 | [Tools toast:error.localizedDescription]; |
| 59 | }]; | 59 | }]; |
| 60 | } else { | 60 | } else { |
| 61 | - [CNLiveUserSystemCenter modifyUserInfoType:_modifyType uid:model.uid modifyInfo:_textField1.text token:model.token success:^(id result) { | 61 | + [CNLiveUserSystemCenter modifyUserInfoType:_modifyType uid:model.uid modifyInfo:_textField1.text success:^(id result) { |
| 62 | 62 | ||
| 63 | NSLog(@"-----------%@",result); | 63 | NSLog(@"-----------%@",result); |
| 64 | if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | 64 | if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { |
CNLiveUserSystemDemo/Conreollers/UserInfoViewController.m
| @@ -188,7 +188,7 @@ | @@ -188,7 +188,7 @@ | ||
| 188 | 188 | ||
| 189 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; | 189 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; |
| 190 | 190 | ||
| 191 | - [CNLiveUserSystemCenter modifyUserInfoType:UserInfoTypeGender uid:model.uid modifyInfo:string token:model.token success:^(id result) { | 191 | + [CNLiveUserSystemCenter modifyUserInfoType:UserInfoTypeGender uid:model.uid modifyInfo:string success:^(id result) { |
| 192 | 192 | ||
| 193 | NSLog(@"%@",result); | 193 | NSLog(@"%@",result); |
| 194 | if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { | 194 | if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { |
| @@ -228,7 +228,7 @@ | @@ -228,7 +228,7 @@ | ||
| 228 | 228 | ||
| 229 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; | 229 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; |
| 230 | 230 | ||
| 231 | - [CNLiveUserSystemCenter uploadIconWithUid:model.uid token:model.token icon:image success:^(id result) { | 231 | + [CNLiveUserSystemCenter uploadIconWithUid:model.uid icon:image success:^(id result) { |
| 232 | 232 | ||
| 233 | NSLog(@"%@",result); | 233 | NSLog(@"%@",result); |
| 234 | 234 |
CNLiveUserSystemDemo/Conreollers/ViewController.m
| @@ -125,7 +125,7 @@ | @@ -125,7 +125,7 @@ | ||
| 125 | 125 | ||
| 126 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; | 126 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; |
| 127 | 127 | ||
| 128 | - [CNLiveUserSystemCenter updateOtherInfoWithUid:model.uid extInfo:@"将要更新的附加信息,NSString类型" token:model.token success:^(id result) { | 128 | + [CNLiveUserSystemCenter updateOtherInfoWithUid:model.uid extInfo:@"将要更新的附加信息,NSString类型" success:^(id result) { |
| 129 | 129 | ||
| 130 | NSLog(@"--------%@",result); | 130 | NSLog(@"--------%@",result); |
| 131 | 131 | ||
| @@ -150,7 +150,7 @@ | @@ -150,7 +150,7 @@ | ||
| 150 | if (indexPath.row == 4) { | 150 | if (indexPath.row == 4) { |
| 151 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; | 151 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; |
| 152 | 152 | ||
| 153 | - [CNLiveUserSystemCenter queryUserInfoWithUid:model.uid srcUid:model.uid token:model.token success:^(id result) { | 153 | + [CNLiveUserSystemCenter queryUserInfoWithUid:model.uid srcUid:model.uid success:^(id result) { |
| 154 | NSLog(@"%@",result); | 154 | NSLog(@"%@",result); |
| 155 | if ([result[@"errorCode"] isEqualToString:@"0"]) { | 155 | if ([result[@"errorCode"] isEqualToString:@"0"]) { |
| 156 | NSDictionary *dic = result[@"data"]; | 156 | NSDictionary *dic = result[@"data"]; |