支付title 字符串过滤

This commit is contained in:
Chopper 2021-06-17 15:06:24 +08:00
parent 383dbb2d4e
commit 897600335e
3 changed files with 23 additions and 0 deletions

View File

@ -226,6 +226,7 @@ lili:
WALLET_PASSWORD: SMS_205755301
system:
isDemoSite: false
isTestModel: true
statistics:
# 在线人数统计 X 小时。这里设置48即统计过去48小时每小时在线人数
onlineMember: 48

View File

@ -12,6 +12,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 字串工具类
@ -250,6 +252,18 @@ public class StringUtils extends StrUtil {
}
return str.concat(appendStr);
}
/**
* 过滤特殊字符串
* @param str
* @return
*/
public static String filterSpecialChart(String str){
String regEx="[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(str);
return m.replaceAll("").trim();
}
}

View File

@ -1,5 +1,6 @@
package cn.lili.modules.payment.kit.params.dto;
import cn.lili.common.utils.StringUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
@ -41,4 +42,11 @@ public class CashierParam {
@ApiModelProperty(value = "剩余余额")
private Double walletValue;
public String getDetail() {
if (StringUtils.isEmpty(detail)) {
return "清单详细";
}
return StringUtils.filterSpecialChart(detail);
}
}