Commit f6e229728a6bc80f627e23e5f3d12d50ba42d50b

Authored by 朱林
1 parent 4bd7aa4e

网络请求改为https

CNLiveUserSystemDemo.xcodeproj/project.xcworkspace/xcuserdata/iOS.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
CNLiveUserSystemDemo.xcodeproj/xcuserdata/iOS.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -2,16 +2,4 @@ @@ -2,16 +2,4 @@
2 <Bucket 2 <Bucket
3 type = "1" 3 type = "1"
4 version = "2.0"> 4 version = "2.0">
5 - <Breakpoints>  
6 - <BreakpointProxy  
7 - BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">  
8 - <BreakpointContent  
9 - shouldBeEnabled = "Yes"  
10 - ignoreCount = "0"  
11 - continueAfterRunningActions = "No"  
12 - scope = "0"  
13 - stopOnStyle = "0">  
14 - </BreakpointContent>  
15 - </BreakpointProxy>  
16 - </Breakpoints>  
17 </Bucket> 5 </Bucket>
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveFeedback.m
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 #import "NSDictionary+Safety.h" 12 #import "NSDictionary+Safety.h"
13 13
14 //反馈 14 //反馈
15 -static NSString *feedbackURL = @"http://api.cnlive.com/open/api2/user/userReport"; 15 +static NSString *feedbackURL = @"https://api.cnlive.com/open/api2/user/userReport";
16 16
17 @implementation CNLiveFeedback 17 @implementation CNLiveFeedback
18 18
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveLogin.m
@@ -12,13 +12,13 @@ @@ -12,13 +12,13 @@
12 #import "NSDictionary+Safety.h" 12 #import "NSDictionary+Safety.h"
13 13
14 //快捷登录 14 //快捷登录
15 -static NSString *shortcutLoginURL = @"http://api.cnlive.com/open/api2/user/loginInQuickly"; 15 +static NSString *shortcutLoginURL = @"https://api.cnlive.com/open/api2/user/loginInQuickly";
16 16
17 //登录 17 //登录
18 -static NSString *loginURL = @"http://api.cnlive.com/open/api2/user/loginIn"; 18 +static NSString *loginURL = @"https://api.cnlive.com/open/api2/user/loginIn";
19 19
20 //第三方登录 20 //第三方登录
21 -static NSString *thirdLoginURL = @"http://api.cnlive.com/open/api2/user/loginIn3rd"; 21 +static NSString *thirdLoginURL = @"https://api.cnlive.com/open/api2/user/loginIn3rd";
22 22
23 @implementation CNLiveLogin 23 @implementation CNLiveLogin
24 24
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveRegister.m
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 #import "NSDictionary+Safety.h" 12 #import "NSDictionary+Safety.h"
13 13
14 //注册 14 //注册
15 -static NSString *registerURL = @"http://api.cnlive.com/open/api2/user/register"; 15 +static NSString *registerURL = @"https://api.cnlive.com/open/api2/user/register";
16 16
17 @implementation CNLiveRegister 17 @implementation CNLiveRegister
18 18
@@ -50,6 +50,13 @@ static NSString *registerURL = @&quot;http://api.cnlive.com/open/api2/user/register&quot; @@ -50,6 +50,13 @@ static NSString *registerURL = @&quot;http://api.cnlive.com/open/api2/user/register&quot;
50 [[CNLiveNetworkManager manager] requestPostURL:registerURL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) { 50 [[CNLiveNetworkManager manager] requestPostURL:registerURL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) {
51 51
52 responseObject = [responseObject validatedDictionary]; 52 responseObject = [responseObject validatedDictionary];
  53 + if ([[responseObject allKeys] containsObject:@"errorCode"] && [responseObject[@"errorCode"] isEqualToString:@"0"]) {
  54 +
  55 + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
  56 + [userDefaults setObject:responseObject[@"data"][@"token"] forKey:@"CNLiveAuthToken"];
  57 + [userDefaults synchronize];
  58 +
  59 + }
53 success(responseObject); 60 success(responseObject);
54 61
55 } failure:^(NSURLResponse * _Nullable response, NSError * _Nullable error) { 62 } failure:^(NSURLResponse * _Nullable response, NSError * _Nullable error) {
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUploadIcon.m
@@ -12,10 +12,10 @@ @@ -12,10 +12,10 @@
12 #import "NSDictionary+Safety.h" 12 #import "NSDictionary+Safety.h"
13 13
14 //获取access_token 14 //获取access_token
15 -static NSString *accessTokenURL = @"http://api.cnlive.com/open/api2/token"; 15 +static NSString *accessTokenURL = @"https://api.cnlive.com/open/api2/token";
16 16
17 //上传头像 17 //上传头像
18 -static NSString *uploadIconURL = @"http://api.cnlive.com/open/api2/user/updateUserFaceById"; 18 +static NSString *uploadIconURL = @"https://api.cnlive.com/open/api2/user/updateUserFaceById";
19 19
20 @implementation CNLiveUploadIcon 20 @implementation CNLiveUploadIcon
21 21
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserInfo.m
@@ -12,19 +12,19 @@ @@ -12,19 +12,19 @@
12 #import "NSDictionary+Safety.h" 12 #import "NSDictionary+Safety.h"
13 13
14 //更新手机号 14 //更新手机号
15 -static NSString *updateMobileURL = @"http://api.cnlive.com/open/api2/user/updateMobileById"; 15 +static NSString *updateMobileURL = @"https://api.cnlive.com/open/api2/user/updateMobileById";
16 16
17 //查询用户信息 17 //查询用户信息
18 -static NSString *queryUserInfoURL = @"http://api.cnlive.com/open/api2/user/readUserById"; 18 +static NSString *queryUserInfoURL = @"https://api.cnlive.com/open/api2/user/readUserById";
19 19
20 //修改用户单项信息 20 //修改用户单项信息
21 -static NSString *updateUserByIdURL = @"http://api.cnlive.com/open/api2/user/updateUserById"; 21 +static NSString *updateUserByIdURL = @"https://api.cnlive.com/open/api2/user/updateUserById";
22 22
23 //更新用户附加信息 23 //更新用户附加信息
24 -static NSString *updateOtherInfoURL = @"http://api.cnlive.com/open/api2/user/updateUserExtInfo"; 24 +static NSString *updateOtherInfoURL = @"https://api.cnlive.com/open/api2/user/updateUserExtInfo";
25 25
26 //修改密码 26 //修改密码
27 -static NSString *updatePwdURL = @"http://api.cnlive.com/open/api2/user/updatePwdByMobile"; 27 +static NSString *updatePwdURL = @"https://api.cnlive.com/open/api2/user/updatePwdByMobile";
28 28
29 @implementation CNLiveUserInfo 29 @implementation CNLiveUserInfo
30 30
@@ -164,6 +164,7 @@ static NSString *updatePwdURL = @&quot;http://api.cnlive.com/open/api2/user/updatePw @@ -164,6 +164,7 @@ static NSString *updatePwdURL = @&quot;http://api.cnlive.com/open/api2/user/updatePw
164 164
165 - (void)requestWithURL:(NSString *)URL parameter:(NSDictionary *)param success:(void(^)(id result))success failure :(void (^)(NSError * error))failure 165 - (void)requestWithURL:(NSString *)URL parameter:(NSDictionary *)param success:(void(^)(id result))success failure :(void (^)(NSError * error))failure
166 { 166 {
  167 +
167 [[CNLiveNetworkManager manager] requestPostURL:URL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) { 168 [[CNLiveNetworkManager manager] requestPostURL:URL parameters:param success:^(NSURLResponse * _Nullable response, id _Nullable responseObject) {
168 169
169 responseObject = [responseObject validatedDictionary]; 170 responseObject = [responseObject validatedDictionary];
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserSystemCenter.h
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 35
36 /** 36 /**
37 @abstract 第三方登录 37 @abstract 第三方登录
38 - @param plat 第三方平台编号(如platform: 1:sina weibo 2:qq weibo 3:weixin 4:renren 注:如qq登录,plat=@"2") 38 + @param plat 第三方平台编号(如plat: 1:sina weibo 2:qq weibo 3:weixin 4:renren 注:如qq登录,plat=@"2")
39 @param thirdPartyId 第三方用户ID 39 @param thirdPartyId 第三方用户ID
40 @param nickName 用户昵称 40 @param nickName 用户昵称
41 @param gender 性别,m:男、f:女、n:未知(非必填) 41 @param gender 性别,m:男、f:女、n:未知(非必填)
@@ -89,7 +89,7 @@ @@ -89,7 +89,7 @@
89 @abstract 修改用户单项信息 89 @abstract 修改用户单项信息
90 @param type 修改类型(nickName-昵称,gender-性别,email-邮箱, location-联系方式) 90 @param type 修改类型(nickName-昵称,gender-性别,email-邮箱, location-联系方式)
91 @param uid 用户ID 91 @param uid 用户ID
92 - @param info 对应的信息(注gender对应f/m 92 + @param info 对应的信息(注gender对应f/m/n
93 @param success 成功回调 93 @param success 成功回调
94 @param failure 失败回调 94 @param failure 失败回调
95 */ 95 */
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveVerificationCode.m
@@ -12,13 +12,13 @@ @@ -12,13 +12,13 @@
12 #import "NSDictionary+Safety.h" 12 #import "NSDictionary+Safety.h"
13 13
14 //快捷登录前发手机验证码 14 //快捷登录前发手机验证码
15 -static NSString *shortcutLoginURL = @"http://api.cnlive.com/open/api2/user/sendVerifyCode"; 15 +static NSString *shortcutLoginURL = @"https://api.cnlive.com/open/api2/user/sendVerifyCode";
16 16
17 //注册或修改手机号前发手机验证码 17 //注册或修改手机号前发手机验证码
18 -static NSString *registerOrModifyURL = @"http://api.cnlive.com/open/api2/user/sendVerifyCodeForUnRegistered"; 18 +static NSString *registerOrModifyURL = @"https://api.cnlive.com/open/api2/user/sendVerifyCodeForUnRegistered";
19 19
20 //找回或修改密码前发手机验证码 20 //找回或修改密码前发手机验证码
21 -static NSString *passwordURL = @"http://api.cnlive.com/open/api2/user/sendVerifyCodeForRegistered"; 21 +static NSString *passwordURL = @"https://api.cnlive.com/open/api2/user/sendVerifyCodeForRegistered";
22 22
23 @implementation CNLiveVerificationCode 23 @implementation CNLiveVerificationCode
24 24
CNLiveUserSystemDemo/Conreollers/LoginViewController.m
@@ -65,11 +65,13 @@ @@ -65,11 +65,13 @@
65 65
66 } else { 66 } else {
67 [Tools toast:result[@"errorMessage"]]; 67 [Tools toast:result[@"errorMessage"]];
  68 + [SVProgressHUD dismiss];
68 } 69 }
69 70
70 } failure:^(NSError *error) { 71 } failure:^(NSError *error) {
71 72
72 [Tools toast:error.localizedDescription]; 73 [Tools toast:error.localizedDescription];
  74 + [SVProgressHUD dismiss];
73 75
74 }]; 76 }];
75 } 77 }
CNLiveUserSystemDemo/Conreollers/ModifyUserInfoViewController.m
@@ -52,10 +52,12 @@ @@ -52,10 +52,12 @@
52 52
53 } else { 53 } else {
54 [Tools toast:result[@"errorMessage"]]; 54 [Tools toast:result[@"errorMessage"]];
  55 + [SVProgressHUD dismiss];
55 } 56 }
56 57
57 } failure:^(NSError *error) { 58 } failure:^(NSError *error) {
58 [Tools toast:error.localizedDescription]; 59 [Tools toast:error.localizedDescription];
  60 + [SVProgressHUD dismiss];
59 }]; 61 }];
60 } else { 62 } else {
61 [CNLiveUserSystemCenter modifyUserInfoType:_modifyType uid:model.uid modifyInfo:_textField1.text success:^(id result) { 63 [CNLiveUserSystemCenter modifyUserInfoType:_modifyType uid:model.uid modifyInfo:_textField1.text success:^(id result) {
@@ -67,10 +69,13 @@ @@ -67,10 +69,13 @@
67 69
68 } else { 70 } else {
69 [Tools toast:result[@"errorMessage"]]; 71 [Tools toast:result[@"errorMessage"]];
  72 + [SVProgressHUD dismiss];
70 } 73 }
71 74
72 } failure:^(NSError *error) { 75 } failure:^(NSError *error) {
73 [Tools toast:error.localizedDescription]; 76 [Tools toast:error.localizedDescription];
  77 + [SVProgressHUD dismiss];
  78 +
74 }]; 79 }];
75 } 80 }
76 81
CNLiveUserSystemDemo/Conreollers/RegisterViewController.m
@@ -95,11 +95,14 @@ @@ -95,11 +95,14 @@
95 95
96 } else { 96 } else {
97 [Tools toast:result[@"errorMessage"]]; 97 [Tools toast:result[@"errorMessage"]];
  98 + [SVProgressHUD dismiss];
  99 +
98 } 100 }
99 101
100 } failure:^(NSError *error) { 102 } failure:^(NSError *error) {
101 103
102 [Tools toast:error.localizedDescription]; 104 [Tools toast:error.localizedDescription];
  105 + [SVProgressHUD dismiss];
103 106
104 }]; 107 }];
105 108
@@ -115,11 +118,13 @@ @@ -115,11 +118,13 @@
115 118
116 } else { 119 } else {
117 [Tools toast:result[@"errorMessage"]]; 120 [Tools toast:result[@"errorMessage"]];
  121 + [SVProgressHUD dismiss];
118 } 122 }
119 123
120 } failure:^(NSError *error) { 124 } failure:^(NSError *error) {
121 125
122 [Tools toast:error.localizedDescription]; 126 [Tools toast:error.localizedDescription];
  127 + [SVProgressHUD dismiss];
123 128
124 }]; 129 }];
125 130
@@ -131,9 +136,11 @@ @@ -131,9 +136,11 @@
131 136
132 } else { 137 } else {
133 [Tools toast:result[@"errorMessage"]]; 138 [Tools toast:result[@"errorMessage"]];
  139 + [SVProgressHUD dismiss];
134 } 140 }
135 } failure:^(NSError *error) { 141 } failure:^(NSError *error) {
136 [Tools toast:error.localizedDescription]; 142 [Tools toast:error.localizedDescription];
  143 + [SVProgressHUD dismiss];
137 144
138 }]; 145 }];
139 } 146 }
CNLiveUserSystemDemo/Conreollers/UserInfoViewController.m
@@ -196,11 +196,12 @@ @@ -196,11 +196,12 @@
196 196
197 } else { 197 } else {
198 [Tools toast:result[@"errorMessage"]]; 198 [Tools toast:result[@"errorMessage"]];
  199 + [SVProgressHUD dismiss];
199 } 200 }
200 201
201 } failure:^(NSError *error) { 202 } failure:^(NSError *error) {
202 [Tools toast:error.localizedDescription]; 203 [Tools toast:error.localizedDescription];
203 - 204 + [SVProgressHUD dismiss];
204 }]; 205 }];
205 } 206 }
206 207
CNLiveUserSystemDemo/Conreollers/ViewController.m
@@ -135,10 +135,12 @@ @@ -135,10 +135,12 @@
135 135
136 } else { 136 } else {
137 [Tools toast:result[@"errorMessage"]]; 137 [Tools toast:result[@"errorMessage"]];
  138 + [SVProgressHUD dismiss];
138 } 139 }
139 140
140 } failure:^(NSError *error) { 141 } failure:^(NSError *error) {
141 [Tools toast:error.localizedDescription]; 142 [Tools toast:error.localizedDescription];
  143 + [SVProgressHUD dismiss];
142 }]; 144 }];
143 } 145 }
144 146
CNLiveUserSystemDemo/Views/RegistBasicInformationView.m
@@ -55,7 +55,7 @@ static BOOL isPhone; @@ -55,7 +55,7 @@ static BOOL isPhone;
55 - (UITextField *)verificationTF 55 - (UITextField *)verificationTF
56 { 56 {
57 if (!_verificationTF) { 57 if (!_verificationTF) {
58 - _verificationTF = [[UITextField alloc] initWithFrame:CGRectMake(10, 57, 170, 57)]; 58 + _verificationTF = [[UITextField alloc] initWithFrame:CGRectMake(10, 57, KScreenWidth - 20, 57)];
59 _verificationTF.placeholder = @"请输入您收到的验证码"; 59 _verificationTF.placeholder = @"请输入您收到的验证码";
60 _verificationTF.keyboardType = UIKeyboardTypeNumberPad; 60 _verificationTF.keyboardType = UIKeyboardTypeNumberPad;
61 _verificationTF.font = [UIFont systemFontOfSize:17]; 61 _verificationTF.font = [UIFont systemFontOfSize:17];