Explorar el Código

增加参数判断

liuyu hace 5 años
padre
commit
0ebf4ad51a
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      app/service/bedroom.js

+ 3 - 1
app/service/bedroom.js

@@ -18,7 +18,9 @@ class BedroomService extends CrudService {
   // 一键分寝
   async apart(data) {
     const { trainplanid, termid, batchid } = data;
-
+    assert(trainplanid, 'trainplanid不能为空');
+    assert(termid, 'termid不能为空');
+    assert(batchid, 'batchid不能为空');
     // 根据计划id取得当前计划
     const trainplan = await this.tmodel.findById({ id: trainplanid });
     // 根据期id取得当前期信息