Skip to content

Commit 8930f51

Browse files
committed
bugfix - 注册登录
1 parent 1556e6c commit 8930f51

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

Coding_iOS/Controllers/Login/CannotLoginViewController.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ - (void)phoneCodeBtnClicked:(PhoneCodeButton *)sender{
222222
sender.enabled = NO;
223223
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:@"api/account/password/forget" withParams:@{@"account": _userStr} withMethodType:Post andBlock:^(id data, NSError *error) {
224224
if (data) {
225+
[NSObject showHudTipStr:@"验证码发送成功"];
225226
[sender startUpTimer];
226227
}else{
227228
[sender invalidateTimer];
@@ -241,8 +242,8 @@ - (void)footerBtnClicked:(id)sender{
241242
}
242243
[self.footerBtn startQueryAnimate];
243244
NSMutableDictionary *params = @{@"account": _userStr,
244-
@"password": _password,
245-
@"confirm": _confirm_password,
245+
@"password": [_password sha1Str],
246+
@"confirm": [_confirm_password sha1Str],
246247
@"code": _phoneCode}.mutableCopy;
247248
params[@"j_captcha"] = _j_captcha;
248249
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:@"api/account/password/reset" withParams:params withMethodType:Post andBlock:^(id data, NSError *error) {
@@ -253,12 +254,11 @@ - (void)footerBtnClicked:(id)sender{
253254
}
254255
}];
255256
}else{
256-
NSString *tipStr = @"重置密码邮件已经发送,请尽快去邮箱查看";
257257
[self.footerBtn startQueryAnimate];
258258
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:@"api/account/password/forget" withParams:@{@"account": _userStr, @"j_captcha": _j_captcha} withMethodType:Post andBlock:^(id data, NSError *error) {
259259
[self.footerBtn stopQueryAnimate];
260260
if (data) {
261-
[NSObject showHudTipStr:tipStr];
261+
[NSObject showHudTipStr:@"重置密码邮件已经发送,请尽快去邮箱查看"];
262262
[self.navigationController popToRootViewControllerAnimated:YES];
263263
}
264264
}];

Coding_iOS/Controllers/Login/RegisterViewController.m

+1
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ - (void)phoneCodeBtnClicked:(PhoneCodeButton *)sender{
323323
sender.enabled = NO;
324324
[[Coding_NetAPIManager sharedManager] request_GeneratePhoneCodeWithPhone:_myRegister.phone type:PurposeToRegister block:^(id data, NSError *error) {
325325
if (data) {
326+
[NSObject showHudTipStr:@"验证码发送成功"];
326327
[sender startUpTimer];
327328
}else{
328329
[sender invalidateTimer];

Coding_iOS/Controllers/MeSetting/SettingPhoneViewController.m

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ - (void)phoneCodeBtnClicked:(PhoneCodeButton *)sender{
101101
sender.enabled = NO;
102102
[[Coding_NetAPIManager sharedManager] request_GeneratePhoneCodeToResetPhone:_phone block:^(id data, NSError *error) {
103103
if (data) {
104+
[NSObject showHudTipStr:@"验证码发送成功"];
104105
[sender startUpTimer];
105106
}else{
106107
[sender invalidateTimer];

Coding_iOS/Models/Login.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ - (instancetype)init
3030
}
3131

3232
- (NSString *)toPath{
33-
return @"https://coding.net/api/v2/account/login";
33+
return @"api/v2/account/login";
3434
}
3535
- (NSDictionary *)toParams{
3636
NSMutableDictionary *params = @{@"account": self.email,

Coding_iOS/Util/Manager/Coding_NetAPIManager.m

+8-3
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,14 @@ - (void)request_ActivateBySetGlobal_key:(NSString *)global_key block:(void (^)(i
312312
- (void)request_SendActivateEmail:(NSString *)email block:(void (^)(id data, NSError *error))block{
313313
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:@"api/account/register/email/send" withParams:@{@"email": email} withMethodType:Post andBlock:^(id data, NSError *error) {
314314
if (data) {
315-
[MobClick event:kUmeng_Event_Request_ActionOfServer label:@"激活账号_重发激活邮件"];
316-
317-
block(data, nil);
315+
if ([(NSNumber *)data[@"data"] boolValue]) {
316+
[MobClick event:kUmeng_Event_Request_ActionOfServer label:@"激活账号_重发激活邮件"];
317+
318+
block(data, nil);
319+
}else{
320+
[NSObject showHudTipStr:@"发送失败"];
321+
block(nil, nil);
322+
}
318323
}else{
319324
block(nil, error);
320325
}

0 commit comments

Comments
 (0)