如何解决NO ‘Access-Control-Allow-Origin’ header is present on the requested resource

When using axios for front-end and back-end communication, a cross-domain problem was reported. See the picture below for details

The solution is as follows:

Add annotations to the corresponding interface control classes and methods

@CrossOrigin

When I tested it again, I got the data I wanted

 

 

 

Guess you like

Origin blog.csdn.net/xgysimida/article/details/108083481