移除 setLocalHours

This commit is contained in:
luying
2021-01-12 20:23:25 +08:00
parent 94ce1fc5dc
commit 08d31ffb8d
4 changed files with 10 additions and 18 deletions
@@ -4,7 +4,7 @@ import Role, { RoleModel, RoleType } from '../db/Role';
import { PvpDefenseModel } from '../db/PvpDefense';
import { getWarJsons, getGamedata, getExpeditionById } from '../pubUtils/gamedata';
import { decodeStr, resResult, setLocalHours, shouldRefresh } from '../pubUtils/util';
import { decodeStr, resResult, shouldRefresh } from '../pubUtils/util';
import { EXPEDITION_CONST, HERO_CE_RATIO, getAttrCeRatio } from '../consts';
import { getAtrrNameById} from '../consts';
import { ExpeditionWarRecordModel } from '../db/ExpeditionWarRecord';
@@ -149,7 +149,7 @@ export async function getCEScaleAndRange(roleId: string, curDicExpedition: any)
// 匹配,判断是不是新手期
const role = await RoleModel.findByRoleId(roleId);
let now = new Date();
let today = setLocalHours(0, now);
let today = now.setHours(0, 0, 0, 0);;
let isNew = today - role.createdAt.getTime() <= 3*24*60*60*1000;
let scale = isNew?curDicExpedition.CEScaleNew:curDicExpedition.CEScale;
let range = isNew?curDicExpedition.CERangeNew:curDicExpedition.CERange;