Skip to content

[BUG] BiliClient 的 GetNavInfo API,当前用户为6级时,json解析失败 #10

@wentiancanye

Description

@wentiancanye

API名称:GetNavInfo
错误原因:当前用户为6级时,json解析失败。因为当用户6级时,next_exp 是 "--",而不是数字。
报错:cannot unmarshal string into Go struct field NavInfoLevel.level_info.next_exp of type int
type NavInfoLevel struct {
CurrentLevel int json:"current_level" // 当前等级
CurrentMin int json:"current_min" // 当前等级经验最低值
CurrentExp int json:"current_exp" // 当前经验
NextExp int json:"next_exp" // 升级下一等级需达到的经验,就是这个会报错
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions