This commit is contained in:
chaosBreaking
2019-10-01 23:58:25 +08:00
parent d7aae190f0
commit 9015ba7064
3 changed files with 5 additions and 4 deletions

View File

@@ -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',

View File

@@ -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: {

View File

@@ -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)) {