File tree 3 files changed +27
-15
lines changed
3 files changed +27
-15
lines changed Original file line number Diff line number Diff line change @@ -413,6 +413,7 @@ - (void)sendLogin{
413
413
if (data) {
414
414
[Login setPreUserEmail: self .myLogin.email];// 记住登录账号
415
415
[((AppDelegate *)[UIApplication sharedApplication ].delegate) setupTabViewController ];
416
+ [self doSomethingAfterLogin ];
416
417
}else {
417
418
NSString *global_key = error.userInfo [@" msg" ][@" two_factor_auth_code_not_empty" ];
418
419
if (global_key.length > 0 ) {
@@ -430,6 +431,29 @@ - (void)sendLogin{
430
431
}
431
432
}
432
433
434
+ - (void )doSomethingAfterLogin {
435
+ User *curUser = [Login curLoginUser ];
436
+ if (curUser.email .length > 0 && !curUser.email_validation .boolValue ) {
437
+ UIAlertView *alertView = [UIAlertView bk_alertViewWithTitle: @" 激活邮箱" message: @" 该邮箱尚未激活,请尽快去邮箱查收邮件并激活账号。如果在收件箱中没有看到,请留意一下垃圾邮件箱子(T_T)" ];
438
+ [alertView bk_setCancelButtonWithTitle: @" 取消" handler: nil ];
439
+ [alertView bk_addButtonWithTitle: @" 重发激活邮件" handler: nil ];
440
+ [alertView bk_setDidDismissBlock: ^(UIAlertView *alert, NSInteger index ) {
441
+ if (index == 1 ) {
442
+ [self sendActivateEmail ];
443
+ }
444
+ }];
445
+ [alertView show ];
446
+
447
+ }
448
+ }
449
+ - (void )sendActivateEmail {
450
+ [[Coding_NetAPIManager sharedManager ] request_SendActivateEmail: [Login curLoginUser ].email block: ^(id data, NSError *error) {
451
+ if (data) {
452
+ [NSObject showHudTipStr: @" 邮件已发送" ];
453
+ }
454
+ }];
455
+ }
456
+
433
457
- (IBAction )cannotLoginBtnClicked : (id )sender {
434
458
CannotLoginViewController *vc = [CannotLoginViewController vcWithMethodType: 0 stepIndex: 0 userStr: (([self .myLogin.email isPhoneNo ] || [self .myLogin.email isEmail ])? self .myLogin.email: nil )];
435
459
[self .navigationController pushViewController: vc animated: YES ];
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
78
78
if (self.myUser .email_validation .boolValue || self.myUser .email .length <= 0 ) {
79
79
TitleValueCell *cell = [tableView dequeueReusableCellWithIdentifier: kCellIdentifier_TitleValue forIndexPath: indexPath];
80
80
cell.selectionStyle = UITableViewCellSelectionStyleNone;
81
- [cell setTitleStr: @" 邮箱" valueStr: self .myUser.email ? : @" 未绑定" ];
81
+ [cell setTitleStr: @" 邮箱" valueStr: self .myUser.email.length > 0 ? self .myUser. email : @" 未绑定" ];
82
82
[tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: kPaddingLeftWidth ];
83
83
return cell;
84
84
}else {
@@ -89,7 +89,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
89
89
}
90
90
}else {
91
91
TitleValueMoreCell *cell = [tableView dequeueReusableCellWithIdentifier: kCellIdentifier_TitleValueMore forIndexPath: indexPath];
92
- [cell setTitleStr: @" 手机号码" valueStr: self .myUser.phone ? : @" 未绑定" ];
92
+ [cell setTitleStr: @" 手机号码" valueStr: self .myUser.phone.length > 0 ? self .myUser. phone : @" 未绑定" ];
93
93
[tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: kPaddingLeftWidth ];
94
94
return cell;
95
95
}
Original file line number Diff line number Diff line change @@ -30,23 +30,12 @@ - (instancetype)init
30
30
}
31
31
32
32
- (NSString *)toPath {
33
- NSString *path = @" https://coding.net/api/v2/account/login" ;
34
- // if ([self.email isPhoneNo]) {
35
- // path = @"api/account/login/phone";
36
- // }else{
37
- // path = @"api/login";
38
- // }
39
- return path;
33
+ return @" https://coding.net/api/v2/account/login" ;
40
34
}
41
35
- (NSDictionary *)toParams {
42
36
NSMutableDictionary *params = @{@" account" : self.email ,
43
37
@" password" : [self .password sha1Str ],
44
38
@" remember_me" : self.remember_me ? @" true" : @" false" ,}.mutableCopy ;
45
- // if ([self.email isPhoneNo]) {
46
- // params[@"phone"] = self.email;
47
- // }else{
48
- // params[@"email"] = self.email;
49
- // }
50
39
if (self.j_captcha .length > 0 ) {
51
40
params[@" j_captcha" ] = self.j_captcha ;
52
41
}
@@ -86,7 +75,6 @@ + (void)doLogin:(NSDictionary *)loginData{
86
75
// NSLog(@"cookies : %@", obj.description);
87
76
// }];
88
77
89
-
90
78
if (loginData) {
91
79
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults ];
92
80
[defaults setObject: [NSNumber numberWithBool: YES ] forKey: kLoginStatus ];
You can’t perform that action at this time.
0 commit comments