跨域访问问题
Failed to load resource: net::ERR_CONNECTION_REFUSED
Access toXMLHttpRequest at ' http://localhost:8080/user/login' from origin
' http://localhost:9999' has been blocked by CORS policy: No
'Access-Control-Allow-Origin' header is present on the requested
resource.添加 @CrossOrigin
swagger突然跳转登录页面
最后原因是导入了security的包,导致权限安全拦截
注释后运行成功
报错:Skipping MapperFactoryBean with name 'userMapper' and 'cn.mbz.parkingsystem.mapper.UserMapper' mapperInterface. Bean already defined with the same name!
No MyBatis mapper was found in ‘[xx.mapper]‘ package. Please check your configuration.
解决方案:
在启动主文件里面把@MapperScan("com.tony.ssmmd.mapper")注释掉就可以了,只保留配置文件com.xxx.xxx.config.MyBatiesPlusConfiguration里面的@MapperScan("com.xxx.xxx.mapper")
其实两个保留一个就可以了
用户列表加载不出来Request failed with status code 500
后端报错
ERROR 18400 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
不能用data,将其改为params。