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

+ 4 - 1
app/service/uploadtask.js

@@ -21,7 +21,10 @@ class UploadtaskService extends CrudService {
     for (const elm of res) {
       const _elm = _.cloneDeep(JSON.parse(JSON.stringify(elm)));
       const stu = await this.stumodel.findById(_elm.studentid);
-      _elm.stuname = stu.name;
+      if (stu)_elm.stuname = stu.name;
+      else {
+        console.error(`学生id:${_elm.studentid}/数据错误`);
+      }
       data.push(_elm);
     }
     return { data, total };