Prechádzať zdrojové kódy

解决聊天消息中 文件失效报错问题。

wukai 2 rokov pred
rodič
commit
31a21ee200

+ 5 - 5
doc-admin/src/main/resources/application-t1.yml

@@ -5,24 +5,24 @@ server:
 # 项目相关配置
 ruoyi:
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
-  profile: D:/ruoyi/uploadPath
+  profile: /opt/doc/uploadPath
 # Spring配置
 spring:
   #es配置
   elasticsearch:
     rest:
-      uris: http://192.168.1.28:19200
+      uris: http://192.168.1.88:19200
   #mongodb配置
   data:
     mongodb:
-      host: 192.168.1.28
+      host: 192.168.1.88
       port: 27017
       database: document
 
   # redis 配置
   redis:
     # 地址
-    host: 192.168.1.28
+    host: 192.168.1.88
     # 端口,默认为6379
     port: 6379
     # 数据库索引
@@ -48,7 +48,7 @@ spring:
     druid:
       # 主库数据源
       master:
-        url: jdbc:mysql://192.168.1.28:3306/doc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://192.168.1.88:3306/doc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         username: root
         password: 123456
       # 从库数据源

+ 5 - 3
doc-biz/src/main/java/com/doc/biz/service/impl/DocInfoServiceImpl.java

@@ -43,9 +43,11 @@ public class DocInfoServiceImpl implements IDocInfoService {
     @Override
     public DocInfo selectDocInfoByDocId(Long docId) {
         DocInfo info = docInfoMapper.selectDocInfoByDocId(docId);
-        String unloading = "l0400";
-        //是否允许转存
-        info.setUnloading(dirService.hasRole(info.getDirId(), unloading));
+        if (info != null) {
+            String unloading = "l0400";
+            //是否允许转存
+            info.setUnloading(dirService.hasRole(info.getDirId(), unloading));
+        }
         return info;
     }
 

+ 3 - 2
doc-biz/src/main/java/com/doc/chat/controller/ChatMsgController.java

@@ -53,11 +53,12 @@ public class ChatMsgController extends BaseController {
     public TableDataInfo record(@PathVariable Long toId) {
         startPage();
         List<ChatMsg> list = chatMsgService.selectRecordList(SecurityUtils.getUserId(), toId);
+        String isRead = "Y";
         list.forEach(msg -> {
-            if (msg.getToId().equals(SecurityUtils.getUserId()) && !"Y".equals(msg.getIsRead())) {
+            if (msg.getToId().equals(SecurityUtils.getUserId()) && !isRead.equals(msg.getIsRead())) {
                 ChatMsg chatMsg = new ChatMsg();
                 chatMsg.setMsgId(msg.getMsgId());
-                chatMsg.setIsRead("Y");
+                chatMsg.setIsRead(isRead);
                 chatMsgService.updateChatMsg(chatMsg);
             }
         });