fix bug 新增武将、装备,等级无法生效

This commit is contained in:
luying
2020-10-13 17:11:32 +08:00
parent 1c455a9b49
commit 682e95561d
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ export default class Hero extends BaseModel {
public static async createHero(heroInfo: {roleId: string, roleName: string, hid: number, hName: string, seqId: number, lv?:number}, lean = true) {
const doc = new HeroModel();
const update = Object.assign(heroInfo, doc.toJSON());
const update = Object.assign(doc.toJSON(), heroInfo);
const hero = await HeroModel.findOneAndUpdate({roleId: heroInfo.roleId, hid: heroInfo.hid}, update, {upsert: true, new: true}).lean(lean);
return hero;
}