本文最后更新于 2024-08-29,文章内容可能已经过时。

在Spring-mvc.xml中加入

<!--跨域访问-->
    <mvc:cors>
        <mvc:mapping path="/**" />
    </mvc:cors>