Commit 1a44e10a cgx

修复已经反馈特殊字符转义等bug

1 个父辈 5c79badf
...@@ -30,6 +30,10 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -30,6 +30,10 @@ NS_ASSUME_NONNULL_BEGIN
/// 将英文双引号转义成\" /// 将英文双引号转义成\"
/// @param oriStr 传入的字符串 /// @param oriStr 传入的字符串
+ (NSString *)transferEnglishDoubleQuotationMarks:(NSString *)oriStr; + (NSString *)transferEnglishDoubleQuotationMarks:(NSString *)oriStr;
/// 转义特殊字符
/// @param oriStr oriStr
+ (NSString *)transferSpecialCharacters:(NSString *)oriStr;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -44,4 +44,14 @@ ...@@ -44,4 +44,14 @@
return @""; return @"";
} }
+ (NSString *)transferSpecialCharacters:(NSString *)oriStr {
if (oriStr && [oriStr isKindOfClass:[NSString class]]) {
oriStr = [oriStr stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
oriStr = [oriStr stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"];
oriStr = [oriStr stringByReplacingOccurrencesOfString:@"\r" withString:@"\\r"];
return oriStr;
}
return @"";
}
@end @end
...@@ -68,7 +68,6 @@ static int AlbumColumnCount = 4; ...@@ -68,7 +68,6 @@ static int AlbumColumnCount = 4;
#pragma mark - UITextViewDelegate #pragma mark - UITextViewDelegate
- (void)textViewDidEndEditing:(UITextView *)textView { - (void)textViewDidEndEditing:(UITextView *)textView {
textView.text = [NSString trimString:textView.text];
[self dealWorldLimitAttTextWithChangeLength:(int)textView.text.length]; [self dealWorldLimitAttTextWithChangeLength:(int)textView.text.length];
} }
...@@ -116,11 +115,11 @@ static int AlbumColumnCount = 4; ...@@ -116,11 +115,11 @@ static int AlbumColumnCount = 4;
[DSProgressHUD showDetailInfo:@"内容不能少于5个字"]; [DSProgressHUD showDetailInfo:@"内容不能少于5个字"];
return; return;
} }
// 发送提交请求 // 发送提交请求
[DSProgressHUD showProgressHUDWithInfo:@"提交中..."]; [DSProgressHUD showProgressHUDWithInfo:@"提交中..."];
_result_imgurls = _result_imgurls ? _result_imgurls : @""; _result_imgurls = _result_imgurls ? _result_imgurls : @"";
NSString * feedStr = [NSString transferEnglishDoubleQuotationMarks:self.feedTV.text]; NSString * feedStr = [NSString transferSpecialCharacters:self.feedTV.text];
[FeedbackRequestModel adviceFeedbackRequestWithContent:feedStr contentImg:_result_imgurls completion:^(FeedbackRequestModel * _Nonnull requestModel) { [FeedbackRequestModel adviceFeedbackRequestWithContent:feedStr contentImg:_result_imgurls completion:^(FeedbackRequestModel * _Nonnull requestModel) {
[DSProgressHUD dissmissProgressHUD]; [DSProgressHUD dissmissProgressHUD];
if (requestModel.resCode == DSResCodeSuccess) { if (requestModel.resCode == DSResCodeSuccess) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!