mirror of
https://github.com/WeiYe-Jing/datax-web.git
synced 2026-07-03 21:08:58 +08:00
This commit is contained in:
parent
7bce036997
commit
39cd3ca3fa
@ -57,7 +57,7 @@ public class AESUtil {
|
||||
return new Base64().encodeToString(result); // 加密
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("content encrypt error {0}",e);
|
||||
log.error("content encrypt error {}",e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -81,7 +81,7 @@ public class AESUtil {
|
||||
return new String(result); // 解密
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("content decrypt error {0}",e);
|
||||
log.error("content decrypt error {}",e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -40,8 +40,15 @@ public class JSONUtils {
|
||||
public static JSONObject decrypt(String content, String key) {
|
||||
JSONObject writer = JSONObject.parseObject(JSONObject.parseObject(content).getString(key));
|
||||
JSONObject writerParams = JSONObject.parseObject(writer.getString("parameter"));
|
||||
writerParams.put("username", AESUtil.decrypt(writerParams.getString("username")));
|
||||
writerParams.put("password", AESUtil.decrypt(writerParams.getString("password")));
|
||||
|
||||
String dUsername = AESUtil.decrypt(writerParams.getString("username"));
|
||||
String username = dUsername == null ? writerParams.getString("username") : dUsername;
|
||||
writerParams.put("username", username);
|
||||
|
||||
String dPassword = AESUtil.decrypt(writerParams.getString("password"));
|
||||
String password = dPassword == null ? writerParams.getString("password") : dPassword;
|
||||
writerParams.put("password", password);
|
||||
|
||||
writer.put("parameter", writerParams);
|
||||
return writer;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user