1.新建配置类:SecurityCoreConfig->SecurityProperties>BrowserProperties:
/**
* 使SecurityProperties及子属性配置类配置生效
* @author zhaohaibin
*/
@Configuration
@EnableConfigurationProperties(SecurityProperties.class)
public class SecurityCoreConfig {
}
/**
* security基础属性配置类
* @author zhaohaibin
*/
@Data
@ConfigurationProperties(prefix = "demo.security")
public class SecurityProperties {
private BrowserProperties browser = new BrowserProperties();
}
/**
* 浏览器属性配置类
* @author zhaohaibin
*/
@Data
public class BrowserProperties {
/**
* 默认登录页
*/
private String loginPage = "/login.html";
}
2.新建跳转控制器:
/**
* 控制页面跳转/信息返回
* @author zhaohaibin
*/
@RestController