Commit 1a44e10a cgx

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

1 个父辈 5c79badf
......@@ -30,6 +30,10 @@ NS_ASSUME_NONNULL_BEGIN
/// 将英文双引号转义成\"
/// @param oriStr 传入的字符串
+ (NSString *)transferEnglishDoubleQuotationMarks:(NSString *)oriStr;
/// 转义特殊字符
/// @param oriStr oriStr
+ (NSString *)transferSpecialCharacters:(NSString *)oriStr;
@end
NS_ASSUME_NONNULL_END
......@@ -44,4 +44,14 @@
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
......@@ -68,7 +68,6 @@ static int AlbumColumnCount = 4;
#pragma mark - UITextViewDelegate
- (void)textViewDidEndEditing:(UITextView *)textView {
textView.text = [NSString trimString:textView.text];
[self dealWorldLimitAttTextWithChangeLength:(int)textView.text.length];
}
......@@ -120,7 +119,7 @@ static int AlbumColumnCount = 4;
// 发送提交请求
[DSProgressHUD showProgressHUDWithInfo:@"提交中..."];
_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) {
[DSProgressHUD dissmissProgressHUD];
if (requestModel.resCode == DSResCodeSuccess) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!