实体
/**
* 白名单
*
* @author huangJunHao
* @date 2022/4/20
*/
@Data
@Component
@ConfigurationProperties(prefix = "sys")
public class WriteUrlConfig {
private List<String> writeUrls1;
private List<writeUrl> writeUrls2;
}
/**
* 白名单
*
* @author huangJunHao
* @date 2022/4/20
*/
@Data
public class writeUrl{
private String name;
private String dsc;
}
代码
@Resource
private WriteUrlConfig writeUrlConfig;
yaml
sys:
#白名单
writeUrls1:
- /user/getSign
- /user/logout
- /user/login
- /user/testLogin
- /user/encryptAccount
- /user/getVerifyCode
- /user/onStoreUAT/login
#白名单
writeUrls1:
- name: /user/getSign
dsc: /user/getSign
- name: /user/getSign
dsc: /user/getSign
- name: /user/getSign
dsc: /user/getSign
实体内的List名字要与配置文件相同