Parcourir la source

增加参数判断

liuyu il y a 5 ans
Parent
commit
0ebf4ad51a
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  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取得当前期信息