Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] xsb我的圣殿获取方式错误 #155

Closed
yyyy52 opened this issue May 15, 2024 · 1 comment
Closed

[BUG] xsb我的圣殿获取方式错误 #155

yyyy52 opened this issue May 15, 2024 · 1 comment

Comments

@yyyy52
Copy link

yyyy52 commented May 15, 2024

问题: 精炼页无法获取圣殿,魔法道具显示固定资产不够
特定: 我的圣殿用将值Name和Hash对比,而现在的Name返回的是bgm用户名而不是用户Hash,并且返回的圣殿信息中不会有用户Hash

/** 我的圣殿 */
@computed get myTemple() {
const { list } = this.charaTemple
return list.find(item => item.name === this.hash) || {}
}

/** 角色圣殿 */
fetchCharaTemple = async (id: Id = 0) => {
const result = await this.fetch(API_TINYGRAIL_CHARA_TEMPLE(id))
let data = {
...LIST_EMPTY
}
if (result.data.State === 0) {
data = {
...LIST_EMPTY,
list: result.data.Value.map((item: typeof CHARA_TEMPLE_ITEM) => ({
avatar: item.Avatar,
id: item.CharacterId,
cover: item.Cover,
name: item.Name,
nickname: item.Nickname,
level: item.Level,
assets: item.Assets,
sacrifices: item.Sacrifices,
refine: item.Refine
})),
_loaded: getTimestamp()
}
}
const key = 'charaTemple'
this.setState({
[key]: {
[id]: data
}
})
return data
}

// https://tinygrail.com/api/chara/temple/3589的返回结果
{
    "State": 0,
    "Value": [
        {
            "Nickname": "北国语雪",
            "Name": "kexi",
            "Avatar": "http://lain.bgm.tv/pic/user/l/000/47/37/473749.jpg?r=1681533589&hd=1",
            "Rate": 0,
            "Price": 0,
            "Extra": 0,
            "CharacterLevel": 0,
            "CharacterName": null,
            "CharacterRank": 0,
            "CharacterStars": 0,
            "CharacterStarForces": 0,
            "Link": null,
            "Id": 233100,
            "UserId": 3955,
            "CharacterId": 3589,
            "Cover": "https://tinygrail.oss-cn-hangzhou.aliyuncs.com/cover/6ffdf87821dac95d956068f29ef74079.jpg",
            "LargeCover": null,
            "Line": null,
            "Source": null,
            "Slots": null,
            "LinkId": 0,
            "LinkedAssets": 0,
            "Create": "2021-03-07T00:05:17",
            "Upgrade": "2021-03-07T00:05:17",
            "LastActive": "2021-03-07T00:05:17",
            "LastUpdate": "0001-01-01T00:00:00",
            "LastLink": "0001-01-01T00:00:00",
            "LastModifier": 738,
            "Assets": 4833,
            "Sacrifices": 578077,
            "Level": 3,
            "StarForces": 578018,
            "Refine": 0,
            "RaidWin": 0,
            "RaidLose": 0,
            "BattleWin": 0,
            "BattleLose": 0,
            "Type": 0,
            "State": 0
        },
        ......
}
@czy0729
Copy link
Owner

czy0729 commented May 15, 2024

@yyyy52 yyyy52 closed this as completed May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants