收货信息不能有+&

This commit is contained in:
wuchunlei
2023-12-25 10:41:45 +08:00
parent a2a3904347
commit b19d04f09d
2 changed files with 16 additions and 0 deletions

View File

@@ -250,6 +250,10 @@ public class BuyOrderController {
buyOrder.setCity(vo.getCity());
buyOrder.setDistrict(vo.getCounty());
buyOrder.setAddress(userAddress.getDetailAddress());
String str = buyOrder.getShippingUser()+buyOrder.getAddress()+buyOrder.getRemark();
if (str.contains("+")||str.contains("&")) {
return R.error(500, "信息中不能含有“+”、“&”符号!");
}
buyOrderService.save(buyOrder);
//解决购物车相关问题
@@ -602,6 +606,10 @@ public class BuyOrderController {
buyOrder.setShippingUser(addressRequestVo.getConsigneeName());
buyOrder.setUserPhone(addressRequestVo.getConsigneeMobile());
buyOrder.setAddress(addressRequestVo.getAddress());
String str = buyOrder.getShippingUser()+buyOrder.getAddress()+buyOrder.getRemark();
if (str.contains("+")||str.contains("&")) {
return R.error(500, "信息中不能含有“+”、“&”符号!");
}
buyOrderService.updateById(buyOrder);
return R.ok();
}