瀏覽代碼

保存动态修改

wuyi 2 年之前
父節點
當前提交
7b4045da58
共有 1 個文件被更改,包括 8 次插入5 次删除
  1. 8 5
      src/moments/moments.service.ts

+ 8 - 5
src/moments/moments.service.ts

@@ -47,6 +47,7 @@ export class MomentsService {
                     this.delay()
                 }, 3 * 60 * 1000)
             }, 24 * 60 * 60 * 1000)
+            //24 * 60
         }, delayTime)
     }
 
@@ -146,11 +147,13 @@ export class MomentsService {
 
         chatRoleList.forEach(async role => {
             const text = await this.chatService.sendMessage(null, role.condition)
-            const momentsDto = new MomentsDto
-            momentsDto.content = text
-            momentsDto.userId = role.id
-            momentsDto.isPush = false
-            await this.momentsRepository.save(momentsDto)
+            if (text.trim() !== '') {
+                const momentsDto = new MomentsDto
+                momentsDto.content = text
+                momentsDto.userId = role.id
+                momentsDto.isPush = false
+                await this.momentsRepository.save(momentsDto)
+            }
         })
     }