add 邮件密码 sysconfig表

master
luoyang 5 years ago
parent 56f15a2244
commit 685a6df62b

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>1.2.42</version> <version>1.2.43</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -65,6 +65,12 @@ public class MailServiceImp implements MailService {
private ClientManager clientManager; private ClientManager clientManager;
@Value("${app.settle.aes-key}") @Value("${app.settle.aes-key}")
private String settleAESKey; private String settleAESKey;
@Value("${app.partner.aes-key}")
private String partnerAESKey;
@Value("${app.risk.aes-key}")
private String riskAESKey;
@Value("${app.risk.control.aes-key}")
private String riskControlAESKey;
/* @Override /* @Override
public void sendEmail(NoticeBean noticeBean) { public void sendEmail(NoticeBean noticeBean) {
@ -126,8 +132,13 @@ public class MailServiceImp implements MailService {
if (files.size() > 0) { if (files.size() > 0) {
noticeBean.setFiles(files.toString()); noticeBean.setFiles(files.toString());
} }
noticeBean.setSenderAddress("info@royalpay.com.au"); JSONObject sysConfig = sysConfigManager.getSysConfig();
noticeBean.setPassword("Rpay2018"); noticeBean.setSenderAddress(sysConfig.getString("partner.email.address"));
String mailPwdEncrypted = sysConfig.getString("partner.email.password");
Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured");
Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey));
String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8);
noticeBean.setPassword(mailPwd);
String postUrl = mailHost + "/mail?" + generateMailSignParam(); String postUrl = mailHost + "/mail?" + generateMailSignParam();
@ -163,8 +174,13 @@ public class MailServiceImp implements MailService {
mailClients.add(mailClient); mailClients.add(mailClient);
noticeBean.setMailClients(mailClients); noticeBean.setMailClients(mailClients);
noticeBean.setContent(content); noticeBean.setContent(content);
noticeBean.setSenderAddress("info@royalpay.com.au"); JSONObject sysConfig = sysConfigManager.getSysConfig();
noticeBean.setPassword("Rpay2018"); noticeBean.setSenderAddress(sysConfig.getString("partner.email.address"));
String mailPwdEncrypted = sysConfig.getString("partner.email.password");
Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured");
Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey));
String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8);
noticeBean.setPassword(mailPwd);
String postUrl = mailHost + "/mail/single?" + generateMailSignParam(); String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
HttpRequestResult result = null; HttpRequestResult result = null;
try { try {
@ -194,8 +210,13 @@ public class MailServiceImp implements MailService {
mailClients.add(mailClient); mailClients.add(mailClient);
noticeBean.setMailClients(mailClients); noticeBean.setMailClients(mailClients);
noticeBean.setContent(content); noticeBean.setContent(content);
noticeBean.setSenderAddress("info@royalpay.com.au"); JSONObject sysConfig = sysConfigManager.getSysConfig();
noticeBean.setPassword("Rpay2018"); noticeBean.setSenderAddress(sysConfig.getString("partner.email.address"));
String mailPwdEncrypted = sysConfig.getString("partner.email.password");
Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured");
Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey));
String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8);
noticeBean.setPassword(mailPwd);
String postUrl = mailHost + "/mail/single?" + generateMailSignParam(); String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
HttpRequestResult result = null; HttpRequestResult result = null;
try { try {
@ -312,11 +333,20 @@ public class MailServiceImp implements MailService {
noticeBean.setMailClients(mailClients); noticeBean.setMailClients(mailClients);
noticeBean.setContent(content); noticeBean.setContent(content);
noticeBean.setAttachFiles(attachFiles); noticeBean.setAttachFiles(attachFiles);
noticeBean.setSenderAddress("riskcontrol@royalpay.com.au"); JSONObject sysConfig = sysConfigManager.getSysConfig();
noticeBean.setPassword("RPrisk123"); noticeBean.setSenderAddress(sysConfig.getString("riskControl.email.address"));
String riskControlMailPwdEncrypted = sysConfig.getString("riskControl.email.password");
Assert.isTrue(StringUtils.isNotEmpty(riskControlMailPwdEncrypted), "riskControl mail pwd not configured");
Key riskControlAesKey = AESCrypt.fromKeyString(Base64.decodeBase64(riskControlAESKey));
String riskControlMailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(riskControlMailPwdEncrypted), riskControlAesKey), StandardCharsets.UTF_8);
noticeBean.setPassword(riskControlMailPwd);
if(order_type == 1 || order_type == 2){ if(order_type == 1 || order_type == 2){
noticeBean.setSenderAddress("risk@royalpay.com.au"); String riskMailPwdEncrypted = sysConfig.getString("risk.email.password");
noticeBean.setPassword("Tunnelrisk123"); Assert.isTrue(StringUtils.isNotEmpty(riskMailPwdEncrypted), "risk mail pwd not configured");
Key riskAesKey = AESCrypt.fromKeyString(Base64.decodeBase64(riskAESKey));
String riskMailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(riskMailPwdEncrypted), riskAesKey), StandardCharsets.UTF_8);
noticeBean.setSenderAddress(sysConfig.getString("risk.email.address"));
noticeBean.setPassword(riskMailPwd);
} }
String postUrl = mailHost + "/mail/single?" + generateMailSignParam(); String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
HttpRequestResult result = null; HttpRequestResult result = null;

@ -113,6 +113,10 @@ im.openim.appkey=24986533
im.openim.secret=96e28e7be21a874177211c31834b5174 im.openim.secret=96e28e7be21a874177211c31834b5174
app.settle.aes-key=EPrfsM2JE69ZPR7BhXn34g== app.settle.aes-key=EPrfsM2JE69ZPR7BhXn34g==
app.partner.aes-key=xyc7Ya6TmL8/csM1ygtviA==
app.risk.aes-key=NRvwd9dgbT2Cdz6zJz9AWA==
app.risk.control.aes-key=Aa+MtthC4Ztq4Kfa9aL+UA==
#清算银行配置 #清算银行配置
settle.abafile.default-bank=CBA settle.abafile.default-bank=CBA
settle.abafile.remains-to=ANZ settle.abafile.remains-to=ANZ

Loading…
Cancel
Save