Skip to content

Commit 30648ca

Browse files
committed
扫码 - 注册 - 设置账号
1 parent 843792b commit 30648ca

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

Coding_iOS/Controllers/Login/RegisterViewController.m

+4
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ - (void)phoneCodeBtnClicked:(PhoneCodeButton *)sender{
332332
}
333333

334334
- (void)sendRegister{
335+
if (![_myRegister.global_key isGK]) {
336+
[NSObject showHudTipStr:@"个性后缀仅支持英文字母、数字、横线(-)以及下划线(_)"];
337+
return;
338+
}
335339
__weak typeof(self) weakSelf = self;
336340
NSMutableDictionary *params = @{@"channel": [Register channel],
337341
@"global_key": _myRegister.global_key,

Coding_iOS/Controllers/MeSetting/SettingAccountViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
8383
return cell;
8484
}else{
8585
TitleValueMoreCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TitleValueMore forIndexPath:indexPath];
86-
[cell setTitleStr:@"邮箱" valueStr:[NSString stringWithFormat:@"%@ - 未验证",self.myUser.email]];
86+
[cell setTitleStr:@"邮箱" valueStr:[NSString stringWithFormat:@"%@ 未验证",self.myUser.email]];
8787
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
8888
return cell;
8989
}

Coding_iOS/Controllers/RootControllers/Project_RootViewController.m

+4
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,10 @@ - (void)dealWithScanResult:(NSString *)resultStr ofVC:(ZXScanCodeViewController
630630
NSURL *URL = [NSURL URLWithString:resultStr];
631631
if (nextVC) {
632632
[self.navigationController pushViewController:nextVC animated:YES];
633+
}else if ([[URL host] hasSuffix:@"coding.net"]){
634+
//网页
635+
WebViewController *webVc = [WebViewController webVCWithUrlStr:resultStr];
636+
[self.navigationController pushViewController:webVc animated:YES];
633637
}else if ([[UIApplication sharedApplication] canOpenURL:URL]){
634638
UIAlertView *alertV = [UIAlertView bk_alertViewWithTitle:@"提示" message:[NSString stringWithFormat:@"可能存在风险,是否打开此链接?\n%@", resultStr]];
635639
[alertV bk_setCancelButtonWithTitle:@"取消" handler:nil];

Coding_iOS/Util/OC_Category/NSString+Common.h

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
//判断是否是手机号码或者邮箱
4747
- (BOOL)isPhoneNo;
4848
- (BOOL)isEmail;
49+
- (BOOL)isGK;
4950

5051
- (NSRange)rangeByTrimmingLeftCharactersInSet:(NSCharacterSet *)characterSet;
5152
- (NSRange)rangeByTrimmingRightCharactersInSet:(NSCharacterSet *)characterSet;

Coding_iOS/Util/OC_Category/NSString+Common.m

+6
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ - (BOOL)isEmail{
341341
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
342342
return [emailTest evaluateWithObject:self];
343343
}
344+
- (BOOL)isGK{
345+
NSString *gkRegex = @"[A-Z0-9a-z-_]{3,32}";
346+
NSPredicate *gkTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", gkRegex];
347+
return [gkTest evaluateWithObject:self];
348+
}
349+
344350

345351
- (NSRange)rangeByTrimmingLeftCharactersInSet:(NSCharacterSet *)characterSet{
346352
NSUInteger location = 0;

0 commit comments

Comments
 (0)