From 63ee51031e7c299624531ccf0096b6ceac342025 Mon Sep 17 00:00:00 2001 From: chaosBreaking Date: Sat, 31 Aug 2019 23:20:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8A=8Ainviter=E6=94=B9=E4=B8=BAstring?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/user/user.controller.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/user/user.controller.js b/src/modules/user/user.controller.js index 25df5e0..ec0e7de 100644 --- a/src/modules/user/user.controller.js +++ b/src/modules/user/user.controller.js @@ -1,13 +1,11 @@ const User = require('./user.model'); const MsgCode = require('../msgCode/msgCode.controller'); const changePwd = require('../sign/sign.controller').changePasswd; -const mongoose = require('mongoose'); module.exports = { changePwd, async createNewUser (data) { let { phone, inviter, password } = data; - if (inviter) inviter = new mongoose.Types.ObjectId(inviter); await (new User({ phone, inviter, password })).save().then(user => user).catch(err => { mylog.error('创建新用户失败', err); return null;