lrf402788946 4 years ago
parent
commit
5a51e61ceb
1 changed files with 6 additions and 2 deletions
  1. 6 2
      app/service/teacher.js

+ 6 - 2
app/service/teacher.js

@@ -23,8 +23,12 @@ class TeacherService extends CrudService {
       .limit(Number(limit));
     res = JSON.parse(JSON.stringify(res));
     for (const tea of res) {
-      const r = await this.umodel.findOne({ uid: tea._id });
-      if (r) tea.openid = _.get(r, 'openid');
+      const r = await this.umodel.findOne({ uid: tea._id }, '+passwd');
+      if (r) {
+        const { passwd } = r;
+        tea.secret = passwd.secret;
+        tea.openid = _.get(r, 'openid');
+      }
     }
     return res;
   }