为方便入门,数据库登录用户、密码不再加密!

This commit is contained in:
dataprince 2023-12-19 16:32:21 +08:00
parent 95e54ad11a
commit ea1411246e
4 changed files with 19 additions and 6 deletions

Binary file not shown.

View File

@ -37,10 +37,16 @@ mybatis-flex:
ds1:
# 指定为HikariDataSource
type: com.zaxxer.hikari.HikariDataSource
# mysql数据库
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
username: root123
password: Root@369---0000
username: root
password: Root@369
#postgresql数据库
# driver-class-name: org.postgresql.Driver
# url: jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
# username: postgres
# password: postgres@369
hikari:
#连接池名

View File

@ -43,10 +43,16 @@ mybatis-flex:
PrimaryDS:
# 指定为HikariDataSource
type: com.zaxxer.hikari.HikariDataSource
# mysql数据库
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
username: root123
password: Root@369---0000
username: root
password: Root@369
#postgresql数据库
# driver-class-name: org.postgresql.Driver
# url: jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
# username: postgres
# password: postgres@369
hikari:
#连接池名

View File

@ -12,13 +12,14 @@ public class Decipher implements DataSourceDecipher {
@Override
public String decrypt(DataSourceProperty property, String value) {
//解密数据源URL用户名密码通过编码支持任意加密方式的解密
//为了减轻入门用户负担默认返回原字符用户可以定制加解密算法
String result = "";
switch (property) {
case URL -> result = value;
case USERNAME -> result = value.substring(0, 4);
case PASSWORD -> result = value.substring(0, 8);
case USERNAME -> result = value;
case PASSWORD -> result = value;
}
return result;
}