mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-07-30 03:03:13 +08:00
@ -231,12 +231,14 @@ public class ConverterServiceImpl implements ConverterService {
|
|||||||
dataSourceDO.setSsh(JSON.toJSONString(sshInfo));
|
dataSourceDO.setSsh(JSON.toJSONString(sshInfo));
|
||||||
if (null != credentialsJson) {
|
if (null != credentialsJson) {
|
||||||
JSONObject userInfo = credentialsJson.getJSONObject(key);
|
JSONObject userInfo = credentialsJson.getJSONObject(key);
|
||||||
JSONObject userPassword = userInfo.getJSONObject(connection);
|
if (null != userInfo) {
|
||||||
dataSourceDO.setUserName(userPassword.getString("user"));
|
JSONObject userPassword = userInfo.getJSONObject(connection);
|
||||||
DesUtil desUtil = new DesUtil(DesUtil.DES_KEY);
|
dataSourceDO.setUserName(userPassword.getString("user"));
|
||||||
String password = userPassword.getString("password");
|
DesUtil desUtil = new DesUtil(DesUtil.DES_KEY);
|
||||||
String encryptStr = desUtil.encrypt(Optional.ofNullable(password).orElse(""), "CBC");
|
String password = userPassword.getString("password");
|
||||||
dataSourceDO.setPassword(encryptStr);
|
String encryptStr = desUtil.encrypt(Optional.ofNullable(password).orElse(""), "CBC");
|
||||||
|
dataSourceDO.setPassword(encryptStr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dataSourceDO.setType(dataBaseType.name());
|
dataSourceDO.setType(dataBaseType.name());
|
||||||
getDataSourceMapper().insert(dataSourceDO);
|
getDataSourceMapper().insert(dataSourceDO);
|
||||||
|
Reference in New Issue
Block a user