优化:减少初始以及合成武将时返回的数据

This commit is contained in:
luying
2022-04-07 18:36:46 +08:00
parent f20583125d
commit 3cb5c650e2
13 changed files with 63 additions and 56 deletions
+4 -4
View File
@@ -8,7 +8,7 @@ import { getCurTask, getPvpTask } from './task/taskService';
import { RoleType } from '../db/Role';
import { Application, FrontendOrBackendSession, pinus, RpcClient } from 'pinus';
import { resResult } from '../pubUtils/util';
import { STATUS, PUSH_BATCH, PUSH_INTERVAL, CONSUME_TYPE, HERO_SELECT, ENTERY_ROLE_PICK } from '../consts';
import { STATUS, PUSH_BATCH, PUSH_INTERVAL, CONSUME_TYPE, HERO_SELECT, ENTERY_ROLE_PICK, JEWEL_SELECT, ITEM_SELECT, SKIN_SELECT } from '../consts';
import { getAllShopList } from './shopService';
import { getGeneralRank, getRankFirstReward } from './rankService';
import { getFriendList, getApplyList } from './friendService';
@@ -109,9 +109,9 @@ async function getModuleData(type: string, data: { role: RoleType, session: Fron
switch (type) {
case 'role':
let heros = await HeroModel.findByRole(role.roleId, [], HERO_SELECT.ENTRY, true);
let jewels = await JewelModel.findbyRole(role.roleId);
let items = await ItemModel.findbyRole(role.roleId);
let skins = await SkinModel.findbyRole(role.roleId);
let jewels = await JewelModel.findbyRole(role.roleId, JEWEL_SELECT.ENTRY);
let items = await ItemModel.findbyRole(role.roleId, ITEM_SELECT.ENTRY);
let skins = await SkinModel.findbyRole(role.roleId, SKIN_SELECT.ENTRY);
role['heros'] = heros.map(hero => new HeroParam(hero));
role['jewels'] = jewels;