diff --git a/apps/profile/ProfileChange.js b/apps/profile/ProfileChange.js index 31e67c2b..a0a7cc67 100644 --- a/apps/profile/ProfileChange.js +++ b/apps/profile/ProfileChange.js @@ -246,7 +246,7 @@ const ProfileChange = { _source: 'change', promote, trees: lodash.extend([], source.trees) - }, char.game, false) + }, char.game) // 设置武器 let wCfg = ds.weapon || {} diff --git a/models/Avatar.js b/models/Avatar.js index 8f54e3db..4fe4cf86 100644 --- a/models/Avatar.js +++ b/models/Avatar.js @@ -23,6 +23,7 @@ export default class Avatar extends Base { this.game = char.game || game this._mysArtis = new Artis(this.game) this._artis = new Artis(this.game, true) + this.setAvatar(ds) } @@ -327,6 +328,9 @@ export default class Avatar extends Base { setArtis (ds = {}, isMysArtis = false) { let artis = this.getArtis(isMysArtis) artis.setArtisData(ds) + if (!this._mysArtis.hasArtis) { + this.setArtis(ds, true) + } } // 获取当前profileData的圣遗物评分,withDetail=false仅返回简略信息 diff --git a/models/Character.js b/models/Character.js index 4223dd8b..5c9a2f92 100644 --- a/models/Character.js +++ b/models/Character.js @@ -121,7 +121,7 @@ class Character extends Base { // 获取角色描述 get desc () { - return CharMeta.getDesc(this.meta.desc || '') + return CharMeta.getDesc(this.meta?._detail?.desc || '') } // 获取头像 @@ -206,8 +206,8 @@ class Character extends Base { // 获取attr列表 getAttrList () { - let { meta } = this - return CharMeta.getAttrList(meta.baseAttr, meta.growAttr, this.elemName) + let { baseAttr, growAttr } = this + return CharMeta.getAttrList(baseAttr, growAttr, this.elemName) } // 获取素材 @@ -254,7 +254,7 @@ class Character extends Base { // 检查时装 checkCostume (id) { - let costume = this.meta?.costume || [] + let costume = this?.costume || [] return costume.includes(id * 1) } diff --git a/models/ProfileDmg.js b/models/ProfileDmg.js index 85c4f793..90958d86 100644 --- a/models/ProfileDmg.js +++ b/models/ProfileDmg.js @@ -5,7 +5,7 @@ import { Character } from './index.js' import DmgBuffs from './dmg/DmgBuffs.js' import DmgAttr from './dmg/DmgAttr.js' import DmgCalc from './dmg/DmgCalc.js' -import { Common, MiaoError } from '#miao' +import { Common, MiaoError, Meta } from '#miao' export default class ProfileDmg extends Base { constructor (profile = {}, game = 'gs') { diff --git a/models/character/CharMeta.js b/models/character/CharMeta.js index 5d13c1b9..3049608a 100644 --- a/models/character/CharMeta.js +++ b/models/character/CharMeta.js @@ -116,7 +116,7 @@ const CharMeta = { return ret }, getMaterials (char, type = 'all') { - let ds = char.meta.materials + let ds = char.materials let ret = [] lodash.forEach(mKeys, (cfg) => { let title = ds[cfg.key]