From aac443a67cc77cbe3c51f0eb13662a8c616ee03f Mon Sep 17 00:00:00 2001 From: chaosBreaking Date: Sat, 7 Sep 2019 15:08:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=93=8D=E5=BA=94=E5=A4=B4=E5=85=81?= =?UTF-8?q?=E8=AE=B8token=EF=BC=9Bfund=E9=87=8Cbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.js | 2 +- src/modules/fund/fund.controller.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app.js b/src/app.js index 1ba4b93..698a5b7 100644 --- a/src/app.js +++ b/src/app.js @@ -12,7 +12,7 @@ app.use(require('compression')()); app.use(require('express').static(path.join(__dirname, '../dist'), { index: 'index.html' })); // 可以指定到 node应用之外的目录上。windows里要把 \ 换成 /。 app.all('*', function(req, res, next) { - res.setHeader('Access-Control-Expose-Headers', 'Access-Token, Uid'); + res.setHeader('Access-Control-Expose-Headers', 'token'); next(); }); diff --git a/src/modules/fund/fund.controller.js b/src/modules/fund/fund.controller.js index c162a97..1fd0d74 100644 --- a/src/modules/fund/fund.controller.js +++ b/src/modules/fund/fund.controller.js @@ -194,14 +194,14 @@ module.exports = { let revenueLastday = 0; if (actions && actions.length > 0) { for (let i = actions.length; i >= 0; i--) { - revenueLastday += actions[i] && +actions[i].amount || 0; + actions[i] && (revenueLastday += actions[i] && +actions[i].amount || 0); } } // 筛选有效矿晶 let activeFund = 0; for (let i = fund.fundList.length; i >= 0; i--) { const fundItem = fund.fundList[i]; - activeFund += fundItem.status === 1 ? +fundItem.amount : 0; + fundItem && (activeFund += fundItem.status === 1 ? +fundItem.amount : 0); } return res.json({ code: 0,