underscore读取,排行榜保护

This commit is contained in:
mamengke01
2021-01-12 14:13:30 +08:00
parent 58f3e94fc0
commit 22f2eed34e
16 changed files with 53 additions and 51 deletions
@@ -7,7 +7,7 @@ import { handleCost } from '../../../services/rewardService';
import { getTitle, getTeraph, gameData, getScollByStar } from '../../../pubUtils/data';
import { SCHOOL, SCROLL } from '../../../pubUtils/dicParam';
import { getTeraphAttr, getAtrrNameById } from '../../../consts/constModules/abilityConst'
const _ = require('underscore');
import { findIndex } from 'underscore';
import { SclResultInter, SclPosInter } from '../../../pubUtils/interface';
import { SchoolModel } from '../../../db/School';
import { checkMaterialEnough } from '../../../services/roleService'
@@ -103,7 +103,7 @@ export class RoleHandler {
let roleId = session.get('roleId');
let role = await RoleModel.findByRoleId(roleId);
let sid: string = session.get('sid');
let index = _.findIndex(role.teraphs, {id});
let index = findIndex(role.teraphs, {id});
if (index < 0)
return resResult(STATUS.WRONG_PARMS);
let teraph = role.teraphs[index];
@@ -138,7 +138,7 @@ export class RoleHandler {
let roleId = session.get('roleId');
let role = await RoleModel.findByRoleId(roleId);
let sid: string = session.get('sid');
let index = _.findIndex(role.teraphs, {id});
let index = findIndex(role.teraphs, {id});
if (index < 0)
return resResult(STATUS.WRONG_PARMS);
let teraph = role.teraphs[index];