zbb20181207 springboot @ConfigurationProperties使用

IgnoredUrlsProperties
package com.zbb.app.aop;
 
import java.util.ArrayList;
import java.util.List;
 
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
 
/**
 * 
 */
@Configuration
@ConfigurationProperties(prefix = "ignored")
public class IgnoredUrlsProperties {
 
    private List<String> urls = new ArrayList<String>();
 
    public List<String> getUrls() {
        return urls;
    }
 
    public void setUrls(List<String> urls) {
        System.out.println("##########################"+urls.toString());
        this.urls = urls;
    }
 
}
 

 


application.yml
spring:
aop:
auto: true
proxy-target-class: true
# 忽略鉴权url
ignored:
urls:
- /app/common/admin/getUserTypeList
- /app/common/admin/sendAuthCodeN

 

posted @ 2018-12-07 16:46  DaryllD  阅读(186)  评论(0编辑  收藏  举报