From ce8304fba4049a99aacc408f7a2e63d1f328b80f Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期一, 12 十二月 2022 09:58:09 +0800
Subject: [PATCH] fix: 实时视频接口

---
 ycl-platform/src/main/java/com/ycl/service/message/impl/MessageServiceImpl.java |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/ycl-platform/src/main/java/com/ycl/service/message/impl/MessageServiceImpl.java b/ycl-platform/src/main/java/com/ycl/service/message/impl/MessageServiceImpl.java
index 639a7d0..f57fa44 100644
--- a/ycl-platform/src/main/java/com/ycl/service/message/impl/MessageServiceImpl.java
+++ b/ycl-platform/src/main/java/com/ycl/service/message/impl/MessageServiceImpl.java
@@ -35,6 +35,7 @@
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Properties;
 import java.util.stream.Collectors;
 
 /**
@@ -91,7 +92,7 @@
         }
 
         ArrayList<Long> ids = new ArrayList<>();
-
+        message.setTargetFrom(umsAdminMapper.selectById(message.getCreateUser()).getUsername());
         for (String receive : message.getTargetTo().split(",")) {
             Message sendMessage = new Message();
             BeanUtils.copyProperties(message, sendMessage);
@@ -182,6 +183,14 @@
         javaMailSender.setHost(sendHost);
         javaMailSender.setUsername(userName);
         javaMailSender.setPassword(password);
+        javaMailSender.setPort(465);
+        Properties properties = new Properties();
+        properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
+        properties.put("mail.smtp.auth", "true");//蹇呴』鏄瓧绗︿覆鑰屼笉鑳芥槸boolean鍚﹀垯鎶ラ敊
+        properties.put("mail.smtp.starttls.enable", "true");
+        properties.put("mail.smtp.timeout", "1000");
+        properties.put("mail.smtp.host", sendHost);
+        javaMailSender.setJavaMailProperties(properties);
         MimeMessage mimeMessage = javaMailSender.createMimeMessage();
         MimeMessageHelper helper = new MimeMessageHelper(mimeMessage);
         helper.setText(message.getBody());

--
Gitblit v1.8.0