10.1
This commit is contained in:
@@ -13,11 +13,12 @@ const { calRevenueLastday, getActiveFund } = require('./fund.handler');
|
|||||||
const { getDate } = require('../../utils/date');
|
const { getDate } = require('../../utils/date');
|
||||||
const Crypto = require('../../utils/crypto');
|
const Crypto = require('../../utils/crypto');
|
||||||
const actionFilter = 'id type amount detail op createdAt tokenType';
|
const actionFilter = 'id type amount detail op createdAt tokenType';
|
||||||
|
const { USDT2VIC_RATE } = require('./constant');
|
||||||
|
|
||||||
const depositCoinsList = [{
|
const depositCoinsList = [{
|
||||||
id: 'usdtETH',
|
id: 'usdtETH',
|
||||||
label: 'usdt',
|
label: 'usdt',
|
||||||
rate: '50'
|
rate: USDT2VIC_RATE
|
||||||
}];
|
}];
|
||||||
const withdrawCoinsList = [{
|
const withdrawCoinsList = [{
|
||||||
id: 'vic',
|
id: 'vic',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const { createNewFund } = require('./fund.handler');
|
|||||||
const { getNewDepositTx, getUSDTTxList } = require('../../common/deposit');
|
const { getNewDepositTx, getUSDTTxList } = require('../../common/deposit');
|
||||||
const User = require('../user/user.model');
|
const User = require('../user/user.model');
|
||||||
|
|
||||||
const USDT2VIC_RATE = 50;
|
const { USDT2VIC_RATE } = require('./constant');
|
||||||
|
|
||||||
const FundSchema = new mongoose.Schema({
|
const FundSchema = new mongoose.Schema({
|
||||||
userId: {
|
userId: {
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ module.exports = {
|
|||||||
const { sig, ts } = req.headers;
|
const { sig, ts } = req.headers;
|
||||||
const salt = SysConfig.LIMITSALT;
|
const salt = SysConfig.LIMITSALT;
|
||||||
const my = crypto.hash(ts + req.path + salt, { hasher: 'md5' });
|
const my = crypto.hash(ts + req.path + salt, { hasher: 'md5' });
|
||||||
const invalid = sig !== my || Date.now() - ts > 60000;
|
const invalid = sig !== my || Date.now() - ts > 5000;
|
||||||
if (invalid) {
|
if (invalid) {
|
||||||
return res.status(403).send('unauthorized');
|
return res.status(408).send('timeout');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!ignoreToken.includes(req.path)) {
|
if(!ignoreToken.includes(req.path)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user