diff --git a/game-server/app/services/task/taskObj.ts b/game-server/app/services/task/taskObj.ts index 744fcc9f8..91851d506 100644 --- a/game-server/app/services/task/taskObj.ts +++ b/game-server/app/services/task/taskObj.ts @@ -333,23 +333,22 @@ export class CheckSingleTask { switch(this.taskType) { case TASK_TYPE.LOGIN_SUM: // 1. 累计登录 x 天 { - let role = this.getRole(); - let today = getZeroPoint(); - if (today > role.loginTime) { - result = { inc: 1 } + let records = await getRecord(); + let today = `${getZeroPoint()}`; + if (records.indexOf(today) == -1) { + result = { inc: 1, records: [...records, today] } } break; } case TASK_TYPE.LOGIN_SERIES: // 2. 连续登录 x 天 { - let role = this.getRole(); - let today = getZeroPoint(); - if (today > role.loginTime) { - if (today - role.loginTime > 24 * 60 * 60) { - result = { set: 1 } - } else { - result = { inc: 1 } - } + let records = await getRecord(); + let today = `${getZeroPoint()}`; + let yesterday = `${getZeroPoint() - 24 * 60 * 60}` + if (records.indexOf(yesterday) == -1) { + result = { set: 1, records: [...records, today] } + } else { + result = { inc: 1, records: [...records, today] } } break; }