关于axios的CORS问题的解决

Axios基础

问题描述

Access to XMLHttpRequest at ‘http://localhost:8080/hello' from origin ‘http://localhost:3000' has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

解决方法

1
@CrossOrigin(origins = "*", maxAge = 3600)