fix: 修改邀请人变量名

This commit is contained in:
chaosBreaking
2019-09-06 22:30:01 +08:00
parent 664ab47b18
commit f88983d821

View File

@@ -68,12 +68,12 @@ module.exports = {
signUpReqInviter: inject(function(SysConfig) {
const { JWT_SECRET, PWD_HASH_SALT } = SysConfig;
return async (req, res) => {
let { phone, code, inviteCode, password } = req.body;
if (!phone || !code || !password || !inviteCode) return res.json({
let { phone, code, inviter, password } = req.body;
if (!phone || !code || !password || !inviter) return res.json({
code: 1,
msg: 'Missing required parameters'
});
const invitePhone = '+86-' + parseInt(inviteCode);
const invitePhone = '+86-' + parseInt(inviter);
const validInviter = await User.findOne({ phone: invitePhone }).catch(null);
if (!validInviter) return res.json({
code: 4,