代码拉取完成,页面将自动刷新
在收货详情中,没有判断当前用户和收货地址是否是本人创建的,会存在越权查看。
可以通过遍历的方式获取所有人的收货地址.
文件路径:platform-api/src/main/java/com/platform/api/ApiAddressController.java
/**
* 获取收货地址的详情
*/
@IgnoreAuth
@RequestMapping("detail")
public Object detail(Integer id) {
AddressVo entity = addressService.queryObject(id);
return toResponsSuccess(entity);
}
建议修改类似
/**
* 获取收货地址的详情
*/
@RequestMapping("detail")
public Object detail(Integer id, @LoginUser UserVo loginUser) {
AddressVo entity = addressService.queryObject(id);
//判断越权行为
if (!entity.getUserId().equals(loginUser.getUserId())) {
return toResponsObject(403, "您无权查看", "");
}
return toResponsSuccess(entity);
}