Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jeecg-boot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
jeecg-boot
Commits
1beddbf8
Commit
1beddbf8
authored
Jun 21, 2021
by
zhangdaiscott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
online表单数据源配置,不支持数据库密码加密 #2672
parent
8921e843
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/config/init/CodeGenerateDbConfig.java
+11
-0
No files found.
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/config/init/CodeGenerateDbConfig.java
View file @
1beddbf8
package
org
.
jeecg
.
config
.
init
;
package
org
.
jeecg
.
config
.
init
;
import
com.alibaba.druid.filter.config.ConfigTools
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jeecgframework.codegenerate.database.CodegenDatasourceConfig
;
import
org.jeecgframework.codegenerate.database.CodegenDatasourceConfig
;
...
@@ -25,11 +26,21 @@ public class CodeGenerateDbConfig {
...
@@ -25,11 +26,21 @@ public class CodeGenerateDbConfig {
private
String
password
;
private
String
password
;
@Value
(
"${spring.datasource.dynamic.datasource.master.driver-class-name:}"
)
@Value
(
"${spring.datasource.dynamic.datasource.master.driver-class-name:}"
)
private
String
driverClassName
;
private
String
driverClassName
;
@Value
(
"${spring.datasource.dynamic.datasource.master.druid.public-key:}"
)
private
String
publicKey
;
@Bean
@Bean
public
CodeGenerateDbConfig
initCodeGenerateDbConfig
()
{
public
CodeGenerateDbConfig
initCodeGenerateDbConfig
()
{
if
(
StringUtils
.
isNotBlank
(
url
)){
if
(
StringUtils
.
isNotBlank
(
url
)){
if
(
StringUtils
.
isNotBlank
(
publicKey
)){
try
{
password
=
ConfigTools
.
decrypt
(
publicKey
,
password
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
" 代码生成器数据库连接,数据库密码解密失败!"
);
}
}
CodegenDatasourceConfig
.
initDbConfig
(
driverClassName
,
url
,
username
,
password
);
CodegenDatasourceConfig
.
initDbConfig
(
driverClassName
,
url
,
username
,
password
);
log
.
info
(
" 代码生成器数据库连接,使用application.yml的DB配置 ###################"
);
log
.
info
(
" 代码生成器数据库连接,使用application.yml的DB配置 ###################"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment