fix CodeCheck

This commit is contained in:
bwcx_jzy 2021-12-01 14:54:20 +08:00
parent 34ddc1eb18
commit 67f2baa1bb
3 changed files with 5 additions and 5 deletions

View File

@ -224,11 +224,11 @@ public class ServerExtConfigBean implements DisposableBean {
}
public String getDbUserName() {
return StrUtil.emptyToDefault(this.dbUserName, DbConfig.DEFAULT_USER_OR_PWD);
return StrUtil.emptyToDefault(this.dbUserName, DbConfig.DEFAULT_USER_OR_AUTHORIZATION);
}
public String getDbUserPwd() {
return StrUtil.emptyToDefault(this.dbUserPwd, DbConfig.DEFAULT_USER_OR_PWD);
return StrUtil.emptyToDefault(this.dbUserPwd, DbConfig.DEFAULT_USER_OR_AUTHORIZATION);
}
public boolean isH2ConsoleEnabled() {

View File

@ -58,7 +58,7 @@ public class DbConfig {
/**
* 默认的账号或者密码
*/
public static final String DEFAULT_USER_OR_PWD = "jpom";
public static final String DEFAULT_USER_OR_AUTHORIZATION = "jpom";
private static DbConfig dbConfig;

View File

@ -131,8 +131,8 @@ public class InitDb implements DisposableBean, InitializingBean {
//
} else {
if (serverExtConfigBean.isH2ConsoleEnabled()
&& StrUtil.equals(serverExtConfigBean.getDbUserName(), DbConfig.DEFAULT_USER_OR_PWD)
&& StrUtil.equals(serverExtConfigBean.getDbUserPwd(), DbConfig.DEFAULT_USER_OR_PWD)) {
&& StrUtil.equals(serverExtConfigBean.getDbUserName(), DbConfig.DEFAULT_USER_OR_AUTHORIZATION)
&& StrUtil.equals(serverExtConfigBean.getDbUserPwd(), DbConfig.DEFAULT_USER_OR_AUTHORIZATION)) {
Console.error("【安全警告】数据库账号密码使用默认的情况下不建议开启 h2 数据 web 控制台");
System.exit(-2);
}