actframework
actframework copied to clipboard
拦截器无法获取传入参数的值
@Before(only = {"create", "update"})
public void beforeSave(SysUser vo) {
if (vo != null && S.isNotEmpty(vo.getUserName())) {
boolean isRepeat = service.hasRepeatUserName(vo);
if (isRepeat) {
ConstraintViolation violation = new BaseConstraintViolation("用户名已存在!");
context.addViolation("vo.userName", violation);
}
}
}
拦截器before里的参数为null, 当参数是对象情况下,有该bug,如果是string等基本类型可以获取参数
能给个简单的复现错误项目吗?