fix: 创建用户的返回值
This commit is contained in:
@@ -5,10 +5,12 @@ const changePwd = require('../sign/sign.controller').changePasswd;
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
changePwd,
|
changePwd,
|
||||||
async createNewUser (data) {
|
async createNewUser (data) {
|
||||||
let { phone, inviter, password } = data;
|
let { phone, inviter = '', password } = data;
|
||||||
await (new User({ phone, inviter, password })).save().then(user => user).catch(err => {
|
await (new User({ phone, inviter, password })).save().then(user => {
|
||||||
|
return user;
|
||||||
|
}).catch(err => {
|
||||||
mylog.error('创建新用户失败', err);
|
mylog.error('创建新用户失败', err);
|
||||||
return null;
|
throw new Error('创建新用户失败', err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getUserInfo (req, res) {
|
async getUserInfo (req, res) {
|
||||||
|
|||||||
Reference in New Issue
Block a user