lrf402788946 4 năm trước cách đây
mục cha
commit
2c756c04df
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      app/service/chatroom.js

+ 1 - 1
app/service/chatroom.js

@@ -18,7 +18,7 @@ class ChatroomService extends CrudService {
     assert(teacher, '缺少教师姓名');
     assert(studentid, '缺少学生id');
     assert(student, '缺少学生姓名');
-    const res = await this.model.find({ teacherid, teacher, studentid, student });
+    const res = await this.model.findOne({ teacherid, teacher, studentid, student });
     if (res) return res;
     const cres = await this.model.create({ teacherid, teacher, studentid, student });
     return cres;