fix bug 新增武将、装备,等级无法生效
This commit is contained in:
@@ -48,7 +48,7 @@ export default class Equip extends BaseModel {
|
||||
|
||||
public static async createEquip(equipInfo: {roleId: string, roleName: string, eid: number, seqId: number, type: number, eName: string, lv?: number}, lean = true) {
|
||||
const doc = new EquipModel();
|
||||
const update = Object.assign(equipInfo, doc.toJSON());
|
||||
const update = Object.assign(doc.toJSON(), equipInfo);
|
||||
const equip = await EquipModel.findOneAndUpdate({ seqId: equipInfo.seqId }, update, {upsert: true, new: true}).lean(lean);
|
||||
return equip;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user