收货信息不能有+&

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();
}

View File

@@ -50,6 +50,10 @@ public class UserAddressController {
if(userAddress.getRegionCode()==null||userAddress.getRegionCode().equals("")){
return R.error("地址异常添加失败!");
}
String str = userAddress.getConsigneeName()+userAddress.getConsigneePhone()+userAddress.getDetailAddress();
if(str.contains("+")||str.contains("&")){
return R.error("信息中不能含有“+”、“&”符号!");
}
userAddressService.save(userAddress);
return R.ok();
}
@@ -59,6 +63,10 @@ public class UserAddressController {
if ((userAddressService.getUserDefaultAddressCount(userAddress.getUserId()) >= 1) && userAddress.getIsDefault() == 1) {
return R.error("已经存在默认地址");
}
String str = userAddress.getConsigneeName()+userAddress.getConsigneePhone()+userAddress.getDetailAddress();
if(str.contains("+")||str.contains("&")){
return R.error("信息中不能含有“+”、“&”符号!");
}
userAddressService.updateById(userAddress);
return R.ok();
}