登录:将写死的数写进const

This commit is contained in:
luying
2021-03-05 19:08:11 +08:00
parent 1479c66f14
commit 0e292b8bda
2 changed files with 13 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ import { getPvpGkWarIds, getPvpRankRewards, getPvpHeroRewards, getResultMaxRank
import { deepCopy, getRandomArr, resResult, shouldRefresh } from '../pubUtils/util';
import { getLvByScore } from './pvpService';
import { getMyRank, setRank, resetPvpRanks, getAllOnlineRoles } from './redisService';
import { MAIL_TYPE, REDIS_KEY, ADULT_AGE, GUEST_MAX_TIME } from '../consts';
import { MAIL_TYPE, REDIS_KEY, ADULT_AGE, GUEST_MAX_TIME, ADDICTION_PREVENTION_CODE } from '../consts';
import { RankParam } from '../domain/rank';
import { RoleModel } from '../db/Role';
import { MailModel, MailType } from '../db/Mail';
@@ -280,8 +280,8 @@ export async function reportOnlineSchedule() {
let age = getAge(birthday);
let isAdult = age >= ADULT_AGE;
// TODO 将code含义写入const
if(result.code != 1) { // 未成年人防沉迷
if(result.code != ADDICTION_PREVENTION_CODE.SUCCESS) { // 未成年人防沉迷
pinus.app.channelService.pushMessageByUids('onPlayTime', resResult(STATUS.SUCCESS, {
isGuest,
guestTime, // 游客已体验时间
@@ -303,7 +303,7 @@ export async function reportOnlineSchedule() {
hasAuthenticated, // 是否进行过实名认证
isAdult, // 是否已成年
todayPlayTime: result.total, // 今天已游戏时长
type: 1
type: ADDICTION_PREVENTION_CODE.GUEST,
} ), [{uid: roleId, sid: sid}]);
}
}