The front-end and back-end separation intelligent parking lot system project, error resolution

Cross domain access problem

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.

Add @CrossOrigin
insert image description here

swagger suddenly jumps to the login page

The final reason is that the security package is imported, resulting in permission security interception
insert image description here

Runs successfully after commenting

报错: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.

solution:
insert image description here

Just comment out @MapperScan("com.tony.ssmmd.mapper") in the main startup file, and only keep @MapperScan("com.xxx.xxx. mapper")
In fact, two of them can be reserved for one

The user list cannot be loaded. 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

insert image description here
Data cannot be used, change it to params.

Guess you like

Origin blog.csdn.net/qq_46556714/article/details/127277609