mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-02 20:08:40 +08:00
fix CodeCheck
This commit is contained in:
parent
34ddc1eb18
commit
67f2baa1bb
@ -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() {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user