武将:修复获取全部武将接口

This commit is contained in:
luying
2021-10-19 16:12:23 +08:00
parent 86b71f21bf
commit b07e4048d0

View File

@@ -625,20 +625,17 @@ export class HeroHandler {
return resResult(STATUS.TOKEN_ERR);
}
let dicHero = gameData.hero;
if (!dicHero) return resResult(STATUS.HERO_NOT_FIND);
let heroes = await HeroModel.findByRole(roleId);
let heroInfos = [];
for (let [hid, dic] of dicHero) {
if(hid < 300 && dic.initialSkin > 0) {
let hasHero = heroes.findIndex(cur => cur.hid == hid);
if(hasHero == -1) {
heroInfos.push({
hid, star: 6, colorStar: 6, quality: 4
});
}
for(let { actorId } of gameData.recruit) {
let dicHero = gameData.hero.get(actorId);
if(!dicHero) continue;
let hasHero = heroes.findIndex(cur => cur.hid == actorId);
if(hasHero == -1) {
heroInfos.push({
hid: actorId, star: 6, colorStar: 6, quality: 4
});
}
}
let resultHeroes = await createHeroes(roleId, roleName, sid, serverId, heroInfos);