解决多环境配置信息读取问题
This commit is contained in:
@ -111,7 +111,17 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
|
||||
|
||||
String config = Stream.of(env.getActiveProfiles()).findFirst().map(first -> first).orElseGet(() -> "default");
|
||||
|
||||
return env.getProperty(String.format(token_url_config_format, config));
|
||||
return StringUtils.getIfEmpty(env.getProperty(format(config.toLowerCase())), () -> {
|
||||
return env.getProperty(format("default"));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text
|
||||
* @return
|
||||
*/
|
||||
private String format(String text) {
|
||||
return String.format(token_url_config_format, text);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user