Authentication注入controller
例如:
@RequestMapping("/example")
public ResponseMessage foo(Authorization auth){
return ok();
}
hsweb: cors: enable: true configs: - /**: allowed-headers: "*" allowed-methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"] allowed-origins: ["http://xxx.example.com"] allow-credentials: true maxAge: 1800enable设为true,但是configs未配置,将使用已下的默认配置:hsweb: cors: enable: true configs: - /**: allowed-headers: "*" allowed-methods: ["GET", "POST", "HEAD"] allowed-origins: "*" allow-credentials: true maxAge: 1800注意: 配置文件中对象的属性名在 SpringBoot 2.x 版本开始不在支持特殊字符,会将特殊字符过滤掉, 仅支持[A-Za-z0-9\-\_],具体细节请查看ConfigurationPropertyName类的adapt方法
Copyright © 2016–2020. All rights reserved.