解决ssm框架跨域问题

在springmvc.xml文件中添加如下配置

<!-- 防止请求跨域 -->
    <mvc:cors>
        <mvc:mapping path="/**" allowed-origins="*"
            allow-credentials="true" max-age="1800" allowed-methods="GET,POST,OPTIONS" />
    </mvc:cors>

转载:https://blog.csdn.net/weixin_41558061/article/details/101097814?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&dist_request_id=&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control

posted @ 2021-03-10 15:23  晚安1024  阅读(105)  评论(0)    收藏  举报