Commit c9c1c27a65e6a24de3e57de70875c3ec0337c239

Authored by 梁星国
1 parent 04f9bf29

提交更改

CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Controller/CNLiveBOrganizationValidattionController.m
@@ -209,6 +209,13 @@ @@ -209,6 +209,13 @@
209 if (!textField) { 209 if (!textField) {
210 return; 210 return;
211 } 211 }
  212 +
  213 + NSLog(@"没有过滤前输入的字符串===%@",textField.text);
  214 + NSString *filterString = [self disableEmoji:textField.text];
  215 + NSLog(@"过滤Emoji表情后的字符串===%@",filterString);
  216 + textField.text = filterString;
  217 +
  218 +
212 CNLiveBOrganizationTextField *TF = (CNLiveBOrganizationTextField *)textField; 219 CNLiveBOrganizationTextField *TF = (CNLiveBOrganizationTextField *)textField;
213 220
214 if (TF.tfIndexPath) { 221 if (TF.tfIndexPath) {
@@ -281,14 +288,35 @@ @@ -281,14 +288,35 @@
281 if (!textView) { 288 if (!textView) {
282 return; 289 return;
283 } 290 }
  291 +
  292 + NSLog(@"没有过滤前输入的字符串===%@",textView.text);
  293 + NSString *filterString = [self disableEmoji:textView.text];
  294 + NSLog(@"过滤Emoji表情后的字符串===%@",filterString);
  295 + textView.text = filterString;
  296 +
284 CNLiveBOrganizationTextView *TV = (CNLiveBOrganizationTextView *)textView; 297 CNLiveBOrganizationTextView *TV = (CNLiveBOrganizationTextView *)textView;
285 if (TV.tvIndexPath) { 298 if (TV.tvIndexPath) {
286 if (TV.tvIndexPath.row == 4) { 299 if (TV.tvIndexPath.row == 4) {
287 self.companyContent = [NSString stringWithFormat:@"%@",TV.text ? TV.text : @""]; 300 self.companyContent = [NSString stringWithFormat:@"%@",TV.text ? TV.text : @""];
288 } 301 }
289 } 302 }
  303 +
290 304
291 - 305 +}
  306 +
  307 +
  308 +/**
  309 + * 正则过滤表情
  310 + */
  311 +- (NSString *)disableEmoji:(NSString *)text
  312 +{
  313 + if (!text.length) return text;
  314 + NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"[^\\u0020-\\u007E\\u00A0-\\u00BE\\u2E80-\\uA4CF\\uF900-\\uFAFF\\uFE30-\\uFE4F\\uFF00-\\uFFEF\\u0080-\\u009F\\u2000-\\u201f\r\n]" options:NSRegularExpressionCaseInsensitive error:nil];
  315 + NSString *modifiedString = [regex stringByReplacingMatchesInString:text
  316 + options:0
  317 + range:NSMakeRange(0, [text length])
  318 + withTemplate:@""];
  319 + return modifiedString;
292 } 320 }
293 321
294 322
@@ -762,7 +790,7 @@ @@ -762,7 +790,7 @@
762 NSDictionary *responseObjectDic = uploadModel.responseObject; 790 NSDictionary *responseObjectDic = uploadModel.responseObject;
763 if ([responseObjectDic containsObjectForKey:@"errorCode"]) { 791 if ([responseObjectDic containsObjectForKey:@"errorCode"]) {
764 if ([[NSString stringWithFormat:@"%@",[responseObjectDic objectForKey:@"errorCode"]] isEqualToString:@"0"] && [responseObjectDic containsObjectForKey:@"data"]) { 792 if ([[NSString stringWithFormat:@"%@",[responseObjectDic objectForKey:@"errorCode"]] isEqualToString:@"0"] && [responseObjectDic containsObjectForKey:@"data"]) {
765 - NSDictionary *dataDic = [dic objectForKey:@"data"]; 793 + NSDictionary *dataDic = [responseObjectDic objectForKey:@"data"];
766 if ([dataDic containsObjectForKey:@"url"]) { 794 if ([dataDic containsObjectForKey:@"url"]) {
767 self.logoUrl = [NSString stringWithFormat:@"%@",[dataDic objectForKey:@"url"] ? [dataDic objectForKey:@"url"]:@""]; 795 self.logoUrl = [NSString stringWithFormat:@"%@",[dataDic objectForKey:@"url"] ? [dataDic objectForKey:@"url"]:@""];
768 } 796 }
@@ -919,7 +947,7 @@ @@ -919,7 +947,7 @@
919 return; 947 return;
920 } 948 }
921 949
922 - if (!self.licenseImageUrl || self.companyShortName.length == 0) { 950 + if (!self.licenseImageUrl || self.licenseImageUrl.length == 0) {
923 [QMUITips showWithText:@"提交失败,请重试" inView:AppKeyWindow hideAfterDelay:0.5]; 951 [QMUITips showWithText:@"提交失败,请重试" inView:AppKeyWindow hideAfterDelay:0.5];
924 return; 952 return;
925 } 953 }
@@ -961,8 +989,7 @@ @@ -961,8 +989,7 @@
961 989
962 }.mutableCopy; 990 }.mutableCopy;
963 991
964 - NSString *contentDic = [NSString stringWithFormat:@"%@",[self objectToJson:dict]];  
965 - contentDic = [contentDic stringByReplacingOccurrencesOfString:@"\\/" withString:@"/"]; 992 + NSString *contentDic = [NSString stringWithFormat:@"%@",[dict mj_JSONString]];
966 NSMutableDictionary *dicCotent = [NSMutableDictionary dictionary]; 993 NSMutableDictionary *dicCotent = [NSMutableDictionary dictionary];
967 [dicCotent setValue:contentDic forKey:@"account"]; 994 [dicCotent setValue:contentDic forKey:@"account"];
968 995
@@ -995,21 +1022,21 @@ @@ -995,21 +1022,21 @@
995 1022
996 } 1023 }
997 1024
998 -- (NSString *)objectToJson:(id)obj{  
999 - if (obj == nil) {  
1000 - return nil;  
1001 - }  
1002 - NSError *error = nil;  
1003 - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:obj  
1004 - options:0  
1005 - error:&error];  
1006 -  
1007 - if ([jsonData length] && error == nil){  
1008 - return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];  
1009 - }else{  
1010 - return nil;  
1011 - }  
1012 -} 1025 +//- (NSString *)objectToJson:(id)obj{
  1026 +// if (obj == nil) {
  1027 +// return nil;
  1028 +// }
  1029 +// NSError *error = nil;
  1030 +// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:obj
  1031 +// options:0
  1032 +// error:&error];
  1033 +//
  1034 +// if ([jsonData length] && error == nil){
  1035 +// return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
  1036 +// }else{
  1037 +// return nil;
  1038 +// }
  1039 +//}
1013 1040
1014 1041
1015 1042
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/View/CNLiveBOrganizationDetailCell.m
@@ -349,7 +349,7 @@ @@ -349,7 +349,7 @@
349 self.titleL.text = titleStr; 349 self.titleL.text = titleStr;
350 NSString *url = @""; 350 NSString *url = @"";
351 if (isDetail) { 351 if (isDetail) {
352 - url = [NSString stringWithFormat:@"%@",detailModel.account.userLogo?detailModel.account.userLogo:@""]; 352 + url = [NSString stringWithFormat:@"%@",detailModel.account.logo?detailModel.account.logo:@""];
353 } 353 }
354 self.contentImageV.frame = CGRectMake(95, 10, 60, 60); 354 self.contentImageV.frame = CGRectMake(95, 10, 60, 60);
355 [self.contentImageV sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamedFromOrganization:@""]]; 355 [self.contentImageV sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamedFromOrganization:@""]];
Example/CNLiveOrganizationValidationModule/CNLIVEBAppDelegate.m
@@ -70,7 +70,7 @@ static NSString * uuid; @@ -70,7 +70,7 @@ static NSString * uuid;
70 CNUserShareModel.faceUrl = @"http://yweb0.cnliveimg.com/images/headImg/2019/1211/1576034177571_small.jpg"; 70 CNUserShareModel.faceUrl = @"http://yweb0.cnliveimg.com/images/headImg/2019/1211/1576034177571_small.jpg";
71 CNUserShareModel.nickname = @""; 71 CNUserShareModel.nickname = @"";
72 CNUserShareModel.mobile = @"15027621766"; 72 CNUserShareModel.mobile = @"15027621766";
73 - CNUserShareModel.uid = @"10514575"; 73 + CNUserShareModel.uid = @"10514577";
74 74
75 } 75 }
76 - (NSString *)appUUIDString 76 - (NSString *)appUUIDString
Example/CNLiveOrganizationValidationModule/CNLIVEBViewController.m
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 #import <CNLiveBeeHive/CNLiveBeeHive.h> 17 #import <CNLiveBeeHive/CNLiveBeeHive.h>
18 #import "CNLiveBOrganizationValidationProtocol.h" 18 #import "CNLiveBOrganizationValidationProtocol.h"
19 #import <YYKit/YYKit.h> 19 #import <YYKit/YYKit.h>
  20 +#import <QMUIKit/QMUIKit.h>
20 21
21 22
22 23
@@ -65,7 +66,9 @@ @@ -65,7 +66,9 @@
65 66
66 [CNLiveNetworking setAllowRequestDefaultArgument:YES]; 67 [CNLiveNetworking setAllowRequestDefaultArgument:YES];
67 [CNLiveNetworking setupShowDataResult:NO]; 68 [CNLiveNetworking setupShowDataResult:NO];
  69 + [QMUITips showLoadingInView:self.view];
68 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { 70 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  71 + [QMUITips hideAllTipsInView:self.view];
69 72
70 NSLog(@"点播详情数据 = %@",responseObject); 73 NSLog(@"点播详情数据 = %@",responseObject);
71 74