feat: 邀请人验证
This commit is contained in:
@@ -72,6 +72,11 @@ module.exports = {
|
||||
code: 1,
|
||||
msg: 'Missing required parameters'
|
||||
});
|
||||
const validInviter = await User.findById(inviter).catch(err => null);
|
||||
if (!validInviter) return res.json({
|
||||
code: 4,
|
||||
msg: '邀请人不存在'
|
||||
});
|
||||
const isCodeValid = await Code.verifyCode({ id: phone, code, type: CODE_TYPE['signUp'] });
|
||||
password = Crypto.hash(password, { salt: PWD_HASH_SALT });
|
||||
if (isCodeValid) {
|
||||
|
||||
Reference in New Issue
Block a user