配置如下:
@Override
public void configure(WebSecurity webSecurity){
//配置免登陆接口
().antMatchers( "/login/bypassword" // 登陆相关
//这里还有许多,为说明问题,把其他的都删掉了
);
}
可是就是这个请求,将参数使用问号拼接时这个配置正常,但是当将参数放置于请求体时,这个请求就会被拦截,要求先登陆。甚是BUG。
FilterChainProxy是一个核心类
private void doFilterInternal(ServletRequest request, ServletResponse response, FilterChain chain)
但是追踪源码才发现被忽略的日志信息
WARN 3828 --- [nio-8080-exec-7] . : Resolved [: Required request body is missing:
日,虚晃一枪,原来是我自己改代码了,把使用实体接收修改成使用String接收!!
loginByVerifyCode(@RequestBody String phoneNumber,@RequestBody String verifyCode,
而传递过来的是放在请求体的Json来接收,但是做不到使用String直接从json体中获取属性值。
而这个异常被错误的捕获。