提交 cae175e8 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 19b187f6
......@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -75,6 +76,9 @@ public class VipController {
@GetMapping(value = "/page")
public CallBack<PageInfo<Vip>> getUserPage(PageParam pageParam) {
PageInfo<Vip> page = service.queryAll(pageParam);
page.getList().forEach(f -> {
f.setIntro(removeLabel(f.getIntro()));
});
// 会员数量
List<PersonalMember> pmList = personalMemberService.queryVipMember();
Map<Integer, Long> map =
......@@ -84,4 +88,32 @@ public class VipController {
map.get(li.getId()).intValue()));
return CallBack.success(page);
}
/**
* 去标签
* @param list
* @author ycw
* @date: 2019年4月18日 上午11:57:55
*/
private String removeLabel(String text){
if(StringUtils.isNotBlank(text)){
//vo.setSummary(vo.getSummary().replaceAll("\\<.*?>", ""));
//定义script的正则表达式{或<script[^>]*?>[\\s\\S]*?<\\/script>
String regEx_script = "<[\\s]*?script[^>]*?>[\\s\\S]*?<[\\s]*?\\/[\\s]*?script[\\s]*?>";
//定义style的正则表达式{或<style[^>]*?>[\\s\\S]*?<\\/style>
String regEx_style = "<[\\s]*?style[^>]*?>[\\s\\S]*?<[\\s]*?\\/[\\s]*?style[\\s]*?>";
// 定义HTML标签的正则表达式
String regEx_html = "<[^>]+>";
// 定义一些特殊字符的正则表达式 如:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
String regEx_special = "\\&[a-zA-Z]{1,10};";
text = text.replaceAll(regEx_script, "")
.replaceAll(regEx_style, "")
.replaceAll(regEx_html, "")
.replaceAll(regEx_special, "");
return text;
}
return null;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论