liuyu 4 years ago
parent
commit
cee871e7e4
2 changed files with 2 additions and 1 deletions
  1. 1 0
      app/model/roomuser.js
  2. 1 1
      app/service/roomuser.js

+ 1 - 0
app/model/roomuser.js

@@ -5,6 +5,7 @@ const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 const RoomUserSchema = {
   name: { type: String, required: false, maxLength: 200 }, // 名称
   phone: { type: String, required: true, maxLength: 64 }, // 手机
+  passwd: { type: String, select: false }, // 注册密码
   openid: { type: String, required: false }, // 微信openid
   role: { type: String, required: false }, // 3-主播 4、房间用户
   deptname: { type: String, required: false }, // 机构名称

+ 1 - 1
app/service/roomuser.js

@@ -23,7 +23,7 @@ class RoomuserService extends CrudService {
     if (has_phone) {
       throw new BusinessError('此手机号已被注册,请更换手机号');
     }
-    const res = await this.model.create(data);
+    const res = await this.ctx.service.user.create(data);
     if (res) {
       const newdata = {
         name,