提交 69d377ab authored 作者:  狄熙卜's avatar 狄熙卜

添加配置读取提示

上级 86c74cd5
...@@ -336,7 +336,7 @@ public class DbEncryptXmlConfig { ...@@ -336,7 +336,7 @@ public class DbEncryptXmlConfig {
try { try {
document = sr.read(configUrl.getFile()); document = sr.read(configUrl.getFile());
} catch (Exception e) { } catch (Exception e) {
LOGGER.error(null, e); LOGGER.error("未在对应位置发现加解密配置文件");
} }
if(document != null){ if(document != null){
Element root = document.getRootElement(); Element root = document.getRootElement();
...@@ -368,7 +368,7 @@ public class DbEncryptXmlConfig { ...@@ -368,7 +368,7 @@ public class DbEncryptXmlConfig {
try { try {
document = sr.read(configUrl.getFile()); document = sr.read(configUrl.getFile());
} catch (Exception e) { } catch (Exception e) {
LOGGER.error(null, e); LOGGER.error("未在对应位置发现加解密配置文件");
} }
if(document != null){ if(document != null){
Element root = document.getRootElement(); Element root = document.getRootElement();
...@@ -406,7 +406,7 @@ public class DbEncryptXmlConfig { ...@@ -406,7 +406,7 @@ public class DbEncryptXmlConfig {
try { try {
document = sr.read(configUrl.getFile()); document = sr.read(configUrl.getFile());
} catch (Exception e) { } catch (Exception e) {
LOGGER.error(null, e); LOGGER.error("未在对应位置发现加解密配置文件");
} }
if(document != null){ if(document != null){
Element root = document.getRootElement(); Element root = document.getRootElement();
...@@ -428,7 +428,7 @@ public class DbEncryptXmlConfig { ...@@ -428,7 +428,7 @@ public class DbEncryptXmlConfig {
try { try {
document = sr.read(configUrl.getFile()); document = sr.read(configUrl.getFile());
} catch (Exception e) { } catch (Exception e) {
LOGGER.error(null, e); LOGGER.error("未在对应位置发现加解密配置文件");
} }
if(document != null){ if(document != null){
Element root = document.getRootElement(); Element root = document.getRootElement();
......
...@@ -19,6 +19,7 @@ import org.reflections.util.ClasspathHelper; ...@@ -19,6 +19,7 @@ import org.reflections.util.ClasspathHelper;
import org.reflections.util.ConfigurationBuilder; import org.reflections.util.ConfigurationBuilder;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Map; import java.util.Map;
...@@ -101,6 +102,11 @@ public class EncryptInterceptor implements Interceptor { ...@@ -101,6 +102,11 @@ public class EncryptInterceptor implements Interceptor {
@Override @Override
public void setProperties(Properties properties) { public void setProperties(Properties properties) {
if(dbEncryptXmlConfig != null && dbEncryptXmlConfig.getConfigUrl() != null && StringUtils.isNotBlank( dbEncryptXmlConfig.getField("CryptType"))) { if(dbEncryptXmlConfig != null && dbEncryptXmlConfig.getConfigUrl() != null && StringUtils.isNotBlank( dbEncryptXmlConfig.getField("CryptType"))) {
try {
System.out.println("已读取加解密配置文件:"+dbEncryptXmlConfig.getConfigUrl().getURL());
} catch (IOException e) {
e.printStackTrace();
}
this.cryptEnable = dbEncryptXmlConfig.getBooleanField("DatabaseEncryptEnable"); this.cryptEnable = dbEncryptXmlConfig.getBooleanField("DatabaseEncryptEnable");
String cryptTypeString = dbEncryptXmlConfig.getField("CryptType"); String cryptTypeString = dbEncryptXmlConfig.getField("CryptType");
CryptType cryptType = CryptType.valueOf(cryptTypeString); CryptType cryptType = CryptType.valueOf(cryptTypeString);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论