lrf402788946 4 år sedan
förälder
incheckning
bf945f5f36
2 ändrade filer med 7 tillägg och 7 borttagningar
  1. 2 2
      app/service/lesson.js
  2. 5 5
      app/service/login.js

+ 2 - 2
app/service/lesson.js

@@ -322,7 +322,7 @@ class LessonService extends CrudService {
       let lydata = await this.getLyTeacherMsg(classInfo);
       // 整理信息
       data = { ...data, ...defaults, termid, classid, planyearid, planid };
-      const dirIsBefore = moment().isBefore(classInfo.startdate);
+      const dirIsBefore = moment().isSameOrBefore(classInfo.startdate);
       if (dirIsBefore) {
         noticeList.push(data);
         if (lydata) {
@@ -340,7 +340,7 @@ class LessonService extends CrudService {
         // 整理时间 TODO,不需要合并时间了,先留着,之后真不需要就删掉
         const { subid, teaid, date } = l;
         // 超过日期了就不发了
-        const isBefore = moment().isBefore(date);
+        const isBefore = moment().isSameOrBefore(date);
         if (!isBefore) continue;
         if (!subid && teaid) continue;
         const r = newArr.find(f => f.subid === subid && f.teaid === teaid);

+ 5 - 5
app/service/login.js

@@ -28,8 +28,8 @@ class LoginService extends CrudService {
       throw new BusinessError(ErrorCode.USER_NOT_EXIST);
     }
     // 验证密码
-    console.log('sjk-->' + res.passwd.secret);
-    console.log('sr-->' + passwd);
+    // console.log('sjk-->' + res.passwd.secret);
+    // console.log('sr-->' + passwd);
     if (res.passwd.secret !== passwd) {
       throw new BusinessError(ErrorCode.BAD_PASSWORD);
     }
@@ -60,11 +60,11 @@ class LoginService extends CrudService {
       res = { userid: _userid, schid: result.schid, schname: result.schname, name, subid: result.subid, type, id: _id, status };
     } else if (type === '4') {
       _userid = uid;
-      console.log('进入查询--' + _userid);
+      // console.log('进入查询--' + _userid);
       const result = await this.stuModel.findById(_userid);
-      console.log(result);
+      // console.log(result);
       res = { userid: _userid, schid: result.schid, schname: result.school_name, termid: result.termid, batchid: result.batchid, classid: result.classid, bedroomid: result.bedroomid, bedroom: result.bedroom, job: result.job, name, type, id: _id, status, planid: result.planid };
-      console.warn(res);
+      // console.warn(res);
     }
     const token = await jwt.sign(res, secret, { expiresIn, issuer, subject });
     return token;