时间:整理时间方法

This commit is contained in:
luying
2021-05-08 19:13:44 +08:00
parent 6f03a96c51
commit 78e3c26a7a
51 changed files with 662 additions and 411 deletions
@@ -86,7 +86,7 @@ export class TowerBattleHandler {
let {timeReward, startTime, deltaTime} = result.data;
let {hangUpSpdUpCnt, lastSpdUpTime} = await RoleModel.findByRoleId(roleId);
let curTime = new Date();
if (!lastSpdUpTime || (shouldRefresh(lastSpdUpTime, curTime, HANG_UP_CONSTS.REFRESH_TIME, 1) && hangUpSpdUpCnt <= HANG_UP_CONSTS.MAX_SPD_UP_CNT)) {
if (!lastSpdUpTime || (shouldRefresh(lastSpdUpTime, curTime) && hangUpSpdUpCnt <= HANG_UP_CONSTS.MAX_SPD_UP_CNT)) {
hangUpSpdUpCnt = HANG_UP_CONSTS.MAX_SPD_UP_CNT;
}
let num = HANG_UP_CONSTS.MAX_SPD_UP_CNT - hangUpSpdUpCnt + 1;
@@ -167,7 +167,7 @@ export class TowerBattleHandler {
let { towerLv, towerTaskRefTime, towerTaskReCnt = 0 } = await RoleModel.findByRoleId(roleId);
let curTasks = await TowerTaskRecModel.getCurTasks(roleId); // 当前显示中的任务
const needRefresh = shouldRefresh(towerTaskRefTime, curTime, TOWER_TASK_CONST.REFRESH_TIME);
const needRefresh = shouldRefresh(towerTaskRefTime, curTime);
if(needRefresh) {
const batchCode = genCode(8);