Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
estateplat-encrypt
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
狄熙卜
estateplat-encrypt
Commits
86c74cd5
提交
86c74cd5
authored
3月 21, 2024
作者:
狄熙卜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加初始化判断
上级
452db1e3
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
45 行增加
和
43 行删除
+45
-43
EncryptInterceptor.java
.../java/cn/gtmap/bdcdj/core/encrypt/EncryptInterceptor.java
+45
-43
没有找到文件。
src/main/java/cn/gtmap/bdcdj/core/encrypt/EncryptInterceptor.java
浏览文件 @
86c74cd5
...
...
@@ -100,50 +100,52 @@ public class EncryptInterceptor implements Interceptor {
*/
@Override
public
void
setProperties
(
Properties
properties
)
{
this
.
cryptEnable
=
dbEncryptXmlConfig
.
getBooleanField
(
"DatabaseEncryptEnable"
);
String
cryptTypeString
=
dbEncryptXmlConfig
.
getField
(
"CryptType"
);
CryptType
cryptType
=
CryptType
.
valueOf
(
cryptTypeString
);
this
.
cryptProperties
=
new
CryptProperties
(
this
.
cryptEnable
,
cryptType
);
if
(
dbEncryptXmlConfig
!=
null
&&
dbEncryptXmlConfig
.
getConfigUrl
()
!=
null
&&
StringUtils
.
isNotBlank
(
dbEncryptXmlConfig
.
getField
(
"CryptType"
)))
{
this
.
cryptEnable
=
dbEncryptXmlConfig
.
getBooleanField
(
"DatabaseEncryptEnable"
);
String
cryptTypeString
=
dbEncryptXmlConfig
.
getField
(
"CryptType"
);
CryptType
cryptType
=
CryptType
.
valueOf
(
cryptTypeString
);
this
.
cryptProperties
=
new
CryptProperties
(
this
.
cryptEnable
,
cryptType
);
String
separator
=
dbEncryptXmlConfig
.
getField
(
"Separator"
);
if
(
StringUtils
.
isNotBlank
(
separator
))
{
this
.
cryptProperties
.
setSeparator
(
separator
);
String
separator
=
dbEncryptXmlConfig
.
getField
(
"Separator"
);
if
(
StringUtils
.
isNotBlank
(
separator
))
{
this
.
cryptProperties
.
setSeparator
(
separator
);
}
String
sm4Salt
=
dbEncryptXmlConfig
.
getField
(
"Sm4Salt"
);
if
(
StringUtils
.
isNotBlank
(
sm4Salt
))
{
this
.
cryptProperties
.
setSm4Salt
(
sm4Salt
);
}
boolean
userSm4KeyEnable
=
dbEncryptXmlConfig
.
getBooleanField
(
"UserSm4KeyEnable"
);
this
.
cryptProperties
.
setUserSm4KeyEnable
(
userSm4KeyEnable
);
String
sm4key
=
dbEncryptXmlConfig
.
getField
(
"Sm4key"
);
if
(
StringUtils
.
isNotBlank
(
sm4key
))
{
this
.
cryptProperties
.
setSm4key
(
sm4key
);
}
String
encoding
=
dbEncryptXmlConfig
.
getField
(
"Encoding"
);
if
(
StringUtils
.
isNotBlank
(
encoding
))
{
this
.
cryptProperties
.
setEncoding
(
encoding
);
}
dbEncryptXmlConfig
.
getGlobalEnableFields
();
dbEncryptXmlConfig
.
getGlobalDisableMapFields
();
dbEncryptXmlConfig
.
getGlobalDisableEntityFields
();
dbEncryptXmlConfig
.
getSqlFields
();
dbEncryptXmlConfig
.
getSqlEncryptFields
();
dbEncryptXmlConfig
.
getSqlDecryptFields
();
dbEncryptXmlConfig
.
getEntityFields
();
dbEncryptXmlConfig
.
getSqlSingleEncryptFields
();
dbEncryptXmlConfig
.
getSqlSingleDecryptFields
();
//添加预置的字段
dbEncryptXmlConfig
.
addBaseConfigFields
();
//根据注解获取加解密配置
dbEncryptXmlConfig
.
addAnnotationConfigFields
();
this
.
cryptProperties
.
setGlobalEnableFields
(
dbEncryptXmlConfig
.
getGlobalEnableFields
());
this
.
cryptProperties
.
setGlobalDisableMapFields
(
dbEncryptXmlConfig
.
getGlobalDisableMapFields
());
this
.
cryptProperties
.
setGlobalDisableEntityFields
(
dbEncryptXmlConfig
.
getGlobalDisableEntityFields
());
this
.
cryptProperties
.
setSqlFields
(
dbEncryptXmlConfig
.
getSqlFields
());
this
.
cryptProperties
.
setSqlEncryptFields
(
dbEncryptXmlConfig
.
getSqlEncryptFields
());
this
.
cryptProperties
.
setSqlDecryptFields
(
dbEncryptXmlConfig
.
getSqlDecryptFields
());
this
.
cryptProperties
.
setEntityFields
(
dbEncryptXmlConfig
.
getEntityFields
());
this
.
cryptProperties
.
setSqlSingleEncryptFields
(
dbEncryptXmlConfig
.
getSqlSingleEncryptFields
());
this
.
cryptProperties
.
setSqlSingleDecryptFields
(
dbEncryptXmlConfig
.
getSqlSingleDecryptFields
());
}
String
sm4Salt
=
dbEncryptXmlConfig
.
getField
(
"Sm4Salt"
);
if
(
StringUtils
.
isNotBlank
(
sm4Salt
)){
this
.
cryptProperties
.
setSm4Salt
(
sm4Salt
);
}
boolean
userSm4KeyEnable
=
dbEncryptXmlConfig
.
getBooleanField
(
"UserSm4KeyEnable"
);
this
.
cryptProperties
.
setUserSm4KeyEnable
(
userSm4KeyEnable
);
String
sm4key
=
dbEncryptXmlConfig
.
getField
(
"Sm4key"
);
if
(
StringUtils
.
isNotBlank
(
sm4key
)){
this
.
cryptProperties
.
setSm4key
(
sm4key
);
}
String
encoding
=
dbEncryptXmlConfig
.
getField
(
"Encoding"
);
if
(
StringUtils
.
isNotBlank
(
encoding
)){
this
.
cryptProperties
.
setEncoding
(
encoding
);
}
dbEncryptXmlConfig
.
getGlobalEnableFields
();
dbEncryptXmlConfig
.
getGlobalDisableMapFields
();
dbEncryptXmlConfig
.
getGlobalDisableEntityFields
();
dbEncryptXmlConfig
.
getSqlFields
();
dbEncryptXmlConfig
.
getSqlEncryptFields
();
dbEncryptXmlConfig
.
getSqlDecryptFields
();
dbEncryptXmlConfig
.
getEntityFields
();
dbEncryptXmlConfig
.
getSqlSingleEncryptFields
();
dbEncryptXmlConfig
.
getSqlSingleDecryptFields
();
//添加预置的字段
dbEncryptXmlConfig
.
addBaseConfigFields
();
//根据注解获取加解密配置
dbEncryptXmlConfig
.
addAnnotationConfigFields
();
this
.
cryptProperties
.
setGlobalEnableFields
(
dbEncryptXmlConfig
.
getGlobalEnableFields
());
this
.
cryptProperties
.
setGlobalDisableMapFields
(
dbEncryptXmlConfig
.
getGlobalDisableMapFields
());
this
.
cryptProperties
.
setGlobalDisableEntityFields
(
dbEncryptXmlConfig
.
getGlobalDisableEntityFields
());
this
.
cryptProperties
.
setSqlFields
(
dbEncryptXmlConfig
.
getSqlFields
());
this
.
cryptProperties
.
setSqlEncryptFields
(
dbEncryptXmlConfig
.
getSqlEncryptFields
());
this
.
cryptProperties
.
setSqlDecryptFields
(
dbEncryptXmlConfig
.
getSqlDecryptFields
());
this
.
cryptProperties
.
setEntityFields
(
dbEncryptXmlConfig
.
getEntityFields
());
this
.
cryptProperties
.
setSqlSingleEncryptFields
(
dbEncryptXmlConfig
.
getSqlSingleEncryptFields
());
this
.
cryptProperties
.
setSqlSingleDecryptFields
(
dbEncryptXmlConfig
.
getSqlSingleDecryptFields
());
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论