springboot读取配置文件
yml配置文件
application.yml
jwt:
header: Authorization #http请求头
ignore-url: /user/register,/user/check
java文件
@Configuration
@ConfigurationProperties(prefix = JwtProperties.JWT_PREFIX)
public class JwtProperties {
public static final String JWT_PREFIX = "jwt";
private String header = "Authorization";
private String ignoreUrl = "";
public static String getJwtPrefix() {
return JWT_PREFIX;
}
public String getIgnoreUrl() {
return ignoreUrl;
}
public void setIgnoreUrl(String ignoreUrl) {
this.ignoreUrl = ignoreUrl;
}
public String getHeader() {
return header;
}
public void setHeader(String header) {
this.header = header;
}
}