There are no modules declared in this project.
CORS与Spring Boot集成
![GitHub release](https://camo.githubusercontent.com/eaf6e6b9730d7bfa1d804d04d80c6155a177c4bef3da6e449ff0fd9bb433d431/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f77696e6468632f636f72732d737072696e672d626f6f742d737461727465722e737667)
使用方法
compile group: "com.windhc", name: "cors-spring-boot-starter", version: "1.1.0"
配置
# 必选。启用cors,值是一个布尔值
cors.enabled=
# 可选。设置允许跨域的接口地址,/**代表所有地址,默认/**
cors.path-pattern=
# 可选。"*",表示接受任意域名的请求, 默认是"*"
cors.allowed-origins=
# 可选。(重要)设置允许跨域的请求方式,例如:GET,POST,PUT等,多个以逗号分隔,"*"代表允许所有的请求方法,默认:GET,HEAD,POST
cors.allowed-methods=
# 可选。配置Access-Control-Allow-Headers, "*"代表允许所有的头,默认允许所有的头
cors.allowed-headers=
# 可选。配置Access-Control-Expose-Headers, 此属性不支持"*",默认不设置
cors.exposed-headers=
# 可选。配置Access-Control-Max-Age, 默认1800秒
cors.max-age=
# 可选。配置Access-Control-Allow-Credentials, 默认true
cors.allow-credentials=
参考资料