增加 SecurityProperties 和 WebProperties 默认值,简化配置

This commit is contained in:
YunaiV
2022-06-11 23:54:30 +08:00
parent 309ba2d3f1
commit b1aa9f484f
5 changed files with 9 additions and 17 deletions

View File

@ -16,18 +16,18 @@ public class SecurityProperties {
* HTTP 请求时,访问令牌的请求 Header
*/
@NotEmpty(message = "Token Header 不能为空")
private String tokenHeader;
private String tokenHeader = "Authorization";
/**
* mock 模式的开关
*/
@NotNull(message = "mock 模式的开关不能为空")
private Boolean mockEnable;
private Boolean mockEnable = false;
/**
* mock 模式的密钥
* 一定要配置密钥,保证安全性
*/
@NotEmpty(message = "mock 模式的密钥不能为空") // 这里设置了一个默认值,因为实际上只有 mockEnable 为 true 时才需要配置。
private String mockSecret = "yudaoyuanma";
private String mockSecret = "test";
}