fix: 特权
This commit is contained in:
@@ -74,12 +74,18 @@ module.exports = {
|
||||
code: 1,
|
||||
msg: 'Missing required parameters'
|
||||
});
|
||||
let validInviter = '';
|
||||
if (inviter === 'AlUx9h!w0)y9') {
|
||||
validInviter = { id: 'AlUx9h!w0)y9' };
|
||||
}
|
||||
else {
|
||||
const invitePhone = '+86-' + parseInt(inviter);
|
||||
const validInviter = await User.findOne({ phone: invitePhone }).catch(null);
|
||||
validInviter = await User.findOne({ phone: invitePhone }).catch(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 });
|
||||
const newInviteCode = typeof phone === 'string' && parseInt(phone.split('-')[1]).toString(36);
|
||||
|
||||
Reference in New Issue
Block a user