feat: 提现

This commit is contained in:
chaosBreaking
2019-09-29 20:49:14 +08:00
parent 471da0b049
commit a31f095699
2 changed files with 5 additions and 4 deletions

View File

@@ -101,7 +101,8 @@ module.exports = {
msg: '缺少必要参数',
error: '缺少必要参数'
});
if (!Number.isFinite(+amount) || !Number.isSafeInteger(+amount) || Number.isNaN(+amount)) return res.json({
// 非常危险 限制了1000万额度
if (!Number.isFinite(+amount) || !Number.isSafeInteger(+amount) || Number.isNaN(+amount) || +amount > 10000000) return res.json({
code: 5,
msg: '非法额度',
error: '非法额度'
@@ -113,9 +114,9 @@ module.exports = {
});
const [user, fund] = await Promise.all([User.findById(userId), Fund.findOne({ userId })]);
if (
(coinId === 'vic' && amount < 1000)
(coinId === 'vic' && +amount < 1000)
||
(coinId === 'usdt' && fund.lastWithdraw.usdt || (new Date() - new Date(fund.lastWithdraw.usdt)) / (1000 * 3600 * 24 * 7) >= 1)
+amount > (fund && +fund.fundSum || 10000)
) {
return res.json({
code: 4,