Commit 92e1cc25 by 罗胜

2024-09-25

明文mysql密码
parent 3abbdef3
...@@ -3,8 +3,8 @@ db.table.prefix=foc_ ...@@ -3,8 +3,8 @@ db.table.prefix=foc_
jdbc.type=mysql jdbc.type=mysql
jdbc.driver.class=com.mysql.jdbc.Driver jdbc.driver.class=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://81.69.44.115:5508/jd_foc?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false jdbc.url=jdbc:mysql://81.69.44.115:5508/jd_foc?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username=sms_develop jdbc.username=b849656b41d3eb136ad6a9d7328d4e6a
jdbc.password=Develop2018!@# jdbc.password=33c9745f057ba48a41d8043f1a007100
#\u521d\u59cb\u5316\u8fde\u63a5 #\u521d\u59cb\u5316\u8fde\u63a5
jdbc.initialSize=0 jdbc.initialSize=0
#\u8fde\u63a5\u6c60\u7684\u6700\u5927\u6d3b\u52a8\u4e2a\u6570 #\u8fde\u63a5\u6c60\u7684\u6700\u5927\u6d3b\u52a8\u4e2a\u6570
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<task:annotation-driven scheduler="scheduler" executor="executor" proxy-target-class="true"/> <task:annotation-driven scheduler="scheduler" executor="executor" proxy-target-class="true"/>
<!-- 数据源配置, 使用 BoneCP 数据库连接池 --> <!-- 数据源配置, 使用 BoneCP 数据库连接池 -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" <bean id="dataSource" class="com.ejweb.core.conf.DataBaseXml"
init-method="init" destroy-method="close"> init-method="init" destroy-method="close">
<!-- 数据源驱动类可不写,Druid默认会自动根据URL识别DriverClass --> <!-- 数据源驱动类可不写,Druid默认会自动根据URL识别DriverClass -->
<property name="driverClassName" value="${jdbc.driver.class}" /> <property name="driverClassName" value="${jdbc.driver.class}" />
......
package com.ejweb.core.conf;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
import cn.hutool.crypto.symmetric.SymmetricCrypto;
import com.alibaba.druid.pool.DruidDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DataBaseXml extends DruidDataSource {
byte[] key =new byte[]{43, -113, 127, 14, -39, 99, -3, -26, 50, 31, -98, -61, -46, 61, 56, 120};
/**
* Log4j logger
*/
private final static Logger lg = LoggerFactory.getLogger(DataBaseXml.class);
@Override
public String getUrl() {
return this.jdbcUrl;
}
@Override
public void setUrl(String jdbcUrl) {
this.jdbcUrl = jdbcUrl;
}
@Override
public String getUsername() {
return this.username;
}
@Override
public void setUsername(String username) {
lg.info("数据库【username】解密初始化加载...");
try {
SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, key);
username = aes.decryptStr(username, CharsetUtil.CHARSET_UTF_8);
} catch (Exception e) {
lg.error("数据库【username】密文解密失败...");
e.printStackTrace();
}
this.username = username;
}
@Override
public String getPassword() {
return this.password;
}
@Override
public void setPassword(String password) {
lg.info("数据库【password】解密初始化加载...");
try {
SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, key);
password = aes.decryptStr(password, CharsetUtil.CHARSET_UTF_8);
} catch (Exception e) {
lg.error("数据库【password】密文解密失败...");
e.printStackTrace();
}
this.password = password;
}
}
...@@ -465,4 +465,6 @@ public class GConstants { ...@@ -465,4 +465,6 @@ public class GConstants {
} }
return projectPath; return projectPath;
} }
} }
...@@ -14,6 +14,7 @@ import java.util.List; ...@@ -14,6 +14,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import com.huawei.esdk.uc.professional.local.utils.AES128Utils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.geo.split.RegionEntity; import org.geo.split.RegionEntity;
import org.geo.split.RegionSplit; import org.geo.split.RegionSplit;
...@@ -52,7 +53,7 @@ public final class IPSeeker { ...@@ -52,7 +53,7 @@ public final class IPSeeker {
return ret; return ret;
} }
} }
private final Map<String, IPLocation> ipCache = new HashMap<String, IPLocation>(); private final Map<String, IPLocation> ipCache = new HashMap<String, IPLocation>();
private final IPLocation loc = new IPLocation(); private final IPLocation loc = new IPLocation();
private final byte[] buf100 = new byte[100]; private final byte[] buf100 = new byte[100];
...@@ -65,7 +66,9 @@ public final class IPSeeker { ...@@ -65,7 +66,9 @@ public final class IPSeeker {
private DatabaseReader reader = null; private DatabaseReader reader = null;
private static IPSeeker INS = new IPSeeker(); private static IPSeeker INS = new IPSeeker();
private IPSeeker() { private IPSeeker() {
// String dir = GConstants.getValue("geoip.db.dir"); // String dir = GConstants.getValue("geoip.db.dir");
// try { // try {
......
...@@ -73,7 +73,7 @@ public class SailingFileService extends CrudService<SailingFileDao, SailingFileE ...@@ -73,7 +73,7 @@ public class SailingFileService extends CrudService<SailingFileDao, SailingFileE
// OutputStream os = null; // OutputStream os = null;
// ByteArrayOutputStream baos = null; // ByteArrayOutputStream baos = null;
// String PATH_FORMAt = GConstants.getValue("file.path.format", "{yyyy}{mm}{dd}"); // String PATH_FORMAt = GConstants.getValue("file.path.format", "{yyyy}{mm}{dd}");
try { // try {
// // 文件扩展名称不能为NULL // // 文件扩展名称不能为NULL
// if (StringUtils.isBlank(originalFilename)) { // if (StringUtils.isBlank(originalFilename)) {
// return null; // return null;
...@@ -136,12 +136,12 @@ public class SailingFileService extends CrudService<SailingFileDao, SailingFileE ...@@ -136,12 +136,12 @@ public class SailingFileService extends CrudService<SailingFileDao, SailingFileE
// os = new BufferedOutputStream(os); // os = new BufferedOutputStream(os);
// os.write(data); // os.write(data);
// os.flush(); // os.flush();
} catch (Exception e) { // } catch (Exception e) {
} finally { // } finally {
IOUtils.closeQuietly(os); // IOUtils.closeQuietly(os);
IOUtils.closeQuietly(in); // IOUtils.closeQuietly(in);
IOUtils.closeQuietly(baos); // IOUtils.closeQuietly(baos);
} // }
return sailingFile; return sailingFile;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment