lrf402788946 4 年之前
父節點
當前提交
ec819abecb
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/service/lesson.js

+ 3 - 2
app/service/lesson.js

@@ -438,7 +438,6 @@ class LessonService extends CrudService {
       // 课表通知,1个班的信息放一起,按班级来看
       const { planyearid, planid, termid, classid, noticeid, type, ncontent, content, username, notifiedid, email, openid } = notice;
       // await this.nmodel.deleteMany({ termid, planid, classid, type });
-      console.log(`${username}-${email}-${openid}`);
       // 排除重复,没有的填进对应的班级中
       let nres = await this.nmodel.findOne({ termid, planid, classid, type });
       if (!nres) {
@@ -461,10 +460,12 @@ class LessonService extends CrudService {
 
       // 邮件
       if (email) {
+        console.log(`email=>${username}-${email}`);
         const subject = '吉林省高等学校毕业生就业指导中心通知';
-        this.ctx.service.util.sendMail('2938260457@qq.com', subject, content);
+        await this.ctx.service.util.sendMail('2938260457@qq.com', subject, content);
       }
       if (openid) {
+        console.log(`openid=>${username}-${openid}`);
         const tourl = this.ctx.app.config.baseUrl + '/msgconfirm/?userid=' + notifiedid + '&noticeid=' + nres._id;
         // TODO 推送
         await this.ctx.service.weixin.sendTemplateDesign(