Vue requests spring boot cross-domain request solution-multiple'Access-Control-Allow-Origin' CORS headers are not allowed

 In the front-end vue, when we call the spring boot interface, a cross-domain error will occur, as shown in the following figure:

 

There are many cross-domain solutions that can be found online, but if you accidentally use multiple solutions together, problems will occur. If there are multiple Access-Control-Allow-Origin in the browser, you have to pay attention to whether it is a solution. The plan has been used too much, and the reason for my problem is:

1. Filters are used on the code to solve cross-domain

 

2. Access-Control-Allow-Origin is also configured in NGINX : *


 

 

 If you only choose to view it, you can see that there are multiple Access-Control-Allow-Origin in the browser, so you can access normally by choosing one of the above strategies!

Guess you like

Origin blog.csdn.net/lchmyhua88/article/details/114317439