feat: 提现
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user