You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

173 lines
4.2 KiB

package com.dxhy.itax.config;
import com.dxhy.itax.utils.AESUtil;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;
@Component
@RefreshScope
@Getter
@Slf4j
public class ItaxAdminConfig {
@Value("${system.logo}")
private String systemLogo;
@Value("${system.projectName}")
private String projectName;
//# 验证码方式 1 文字识别验证码验证 2 短信验证码验证 3、滑块验证吗 默认1
@Value("${itax.verifyWay:1}")
private String verifyWayType;
//# 用户中心 1 项目 2 SAAS 默认项目1
@Value("${itax.userCenterType:1}")
private String userCenterType;
@Value("${dxhy-protect-menuId.menuId}")
private String menuId;
@Value("${dxhy-protect-menuId.indexConfigMenuId}")
private String indexConfigMenuId;
@Value("${dxhy-protect-menuId.TABMenuId}")
private String TABMenuId;
@Value("${dxhy-protect-menuId.jobMenuId}")
private String jobMenuId;
//系统默认初始化密码
@Value("${itax.passWord:itax1234!@#}")
private String passWord;
@Value("${dxhy-protect-menuId.passwordUpdateDay:180}")
private int passwordUpdateDay;
//# 首页展示情况 1 新首页 2 老首页展示 默认1
@Value("${itax.showHome:1}")
private String showHomeType;
//# 首页展示情况 1 抽屉页面排版 2 平铺页面排版 默认1
@Value("${itax.menuSettingType:1}")
private String menuSettingType;
@Value("${dxhy.sso.redirect_url}")
private String redirectUrl;
@Value("${dxhy.sso.omp_redirect_url:''}")
private String ompRedirectUrl;
@Value("${itax-url.itax-base-api}")
private String itaxBaseUrl;
@Value("${itax-url.itax-bench-front}")
private String itaxbenchfront;
@Value("${dxhy-sso.excluded.redirectUrl:''}")
private String excludedUrl;
@Value("${itax.tryCount:5}")
private int tryCount;
@Value("${itax.tryMinite:1}")
private int tryMinite;
@Value("${itax.forbidMinute:60}")
private int forbidMinute;
@Value("${dxhyLogin.redisTemplate:true}")
private Boolean open;
@Value("${itax.pwdAesKey:abcdefgabcdxhy12}")
private String pwdAesKey;
@Value("${oauth.singleLogin}")
private String lxOauth;
@Value("${oauth.whitelist}")
private String whitelist;
private static final PasswordEncoder ENCODER = new BCryptPasswordEncoder();
public String systemLogo(){
return systemLogo;
}
public String projectName(){
return projectName;
}
public String verifyWayType(){
return verifyWayType;
}
public String userCenterType(){
return userCenterType;
}
public String menuId(){
return menuId;
}
public String indexConfigMenuId(){
return indexConfigMenuId;
}
public String TABMenuId(){
return TABMenuId;
}
public String jobMenuId(){
return jobMenuId;
}
public String getPassWord(){
return passWord;
}
public int passwordUpdateDay(){
return passwordUpdateDay;
}
public PasswordEncoder ENCODER(){
return ENCODER;
}
public String getShowHomeType(){
return showHomeType;
}
public String getRedirectUrl(){
return redirectUrl;
}
public String getItaxbenchfront(){
return itaxbenchfront;
}
public String getExcludedUrl(){
return excludedUrl;
}
public int getTryCount(){
return tryCount;
}
public int tryMinite(){
return tryMinite;
}
public int forbidMinute(){
return forbidMinute;
}
public Boolean open(){
return open;
}
public String decryptPwd(String pwd){
try {
return AESUtil.aesDecrypt(pwd, pwdAesKey);
} catch (Exception e){
log.error("密码解析失败", e);
}
return null;
}
}