防沉迷:不使用厚土sdk

This commit is contained in:
luying
2021-08-20 18:33:11 +08:00
parent 04ceea3962
commit d047ddeb61
14 changed files with 174 additions and 105 deletions
+3 -6
View File
@@ -9,7 +9,8 @@ import Counter from '@db/Counter';
import { getExpByLv } from '../pubUtils/data';
import { isString } from 'underscore';
import { getAge } from '../pubUtils/timeUtil';
import { shouldRefresh, resResult } from '../pubUtils/util';
import { resResult } from '../pubUtils/util';
import { checkTeeanAgerTime } from '../pubUtils/authenticateUtil';
import { authenticate } from '../pubUtils/httpUtil';
import { checkTask, getCreateUserFuncs } from 'app/pubUtils/taskUtil';
@@ -82,11 +83,7 @@ export default class Auth extends Service {
let age = getAge(user.birthday);
let isAdult = age >= ADULT_AGE;
let todayPlayTime = user.todayPlayTime;
let type = user.todayPlayType;
if (shouldRefresh(user.reportTime, new Date(), 0)) {
todayPlayTime = 0;
type = 0;
}
let type = checkTeeanAgerTime(isAdult, todayPlayTime);
if ((user.isGuest || !user.hasAuthenticated) && user.guestTime > GUEST_MAX_TIME) {
type = ADDICTION_PREVENTION_CODE.GUEST;
}