Browse Source

增加参数判断

liuyu 5 years ago
parent
commit
0ebf4ad51a
1 changed files with 3 additions and 1 deletions
  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取得当前期信息