feat(role): 增加用户绑定角色信息查询与作战表展示

- 逆向并实现虎牙活动绑角色接口 webActUI.checkUserBindGameAccount,支持精准解析游戏角色名、区服和平台
- 增加本地持久化 roles.json 存储,启动即回显角色信息无需重复请求
- 前端账号作战表与 CK 管理列表整合角色展示([微信-安卓] 角色名),直观区分账号归属
- 工具栏增加「查询角色」按钮,并以兑换记录中的历史账号作为双重兜底
- 升级版本至 v0.5.5 并成功交叉编译 Windows 产物
This commit is contained in:
yml2213
2026-10-19 12:09:24 +08:00
parent c0be784be9
commit 7dadcd1644
19 changed files with 1032 additions and 31 deletions
+6
View File
@@ -10,6 +10,8 @@ export function DefaultConfig():Promise<gui.Config>;
export function Exchange(arg1:gui.Config):Promise<Array<gui.ExchangeResult>>;
export function GetCachedRoles():Promise<Record<string, gui.RoleInfo>>;
export function GetInstanceInfo():Promise<gui.InstanceInfo>;
export function GetLogFilePath():Promise<string>;
@@ -30,6 +32,10 @@ export function OpenLogDir():Promise<void>;
export function PreviewAccounts(arg1:string):Promise<Array<gui.AccountPreview>>;
export function QueryAccountRoles(arg1:gui.Config):Promise<Array<gui.RoleResult>>;
export function QueryRoles(arg1:gui.Config):Promise<Array<gui.RoleResult>>;
export function QueryScores(arg1:gui.Config):Promise<Array<gui.ScoreResult>>;
export function ReconcileScores(arg1:gui.Config):Promise<Array<score.ReconcileItem>>;
+12
View File
@@ -14,6 +14,10 @@ export function Exchange(arg1) {
return window['go']['gui']['App']['Exchange'](arg1);
}
export function GetCachedRoles() {
return window['go']['gui']['App']['GetCachedRoles']();
}
export function GetInstanceInfo() {
return window['go']['gui']['App']['GetInstanceInfo']();
}
@@ -54,6 +58,14 @@ export function PreviewAccounts(arg1) {
return window['go']['gui']['App']['PreviewAccounts'](arg1);
}
export function QueryAccountRoles(arg1) {
return window['go']['gui']['App']['QueryAccountRoles'](arg1);
}
export function QueryRoles(arg1) {
return window['go']['gui']['App']['QueryRoles'](arg1);
}
export function QueryScores(arg1) {
return window['go']['gui']['App']['QueryScores'](arg1);
}
+171
View File
@@ -260,6 +260,52 @@ export namespace gui {
return a;
}
}
export class RoleResult {
uid: number;
role_name: string;
area_name: string;
plat_name: string;
display_name: string;
game_name: string;
is_bound: boolean;
resp?: huya.CheckUserBindGameAccountResp;
error?: string;
static createFrom(source: any = {}) {
return new RoleResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uid = source["uid"];
this.role_name = source["role_name"];
this.area_name = source["area_name"];
this.plat_name = source["plat_name"];
this.display_name = source["display_name"];
this.game_name = source["game_name"];
this.is_bound = source["is_bound"];
this.resp = this.convertValues(source["resp"], huya.CheckUserBindGameAccountResp);
this.error = source["error"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class ScoreResult {
uid: number;
score: number;
@@ -341,6 +387,128 @@ export namespace huya {
this.total = source["total"];
}
}
export class GameRole {
role_id: string;
role_name: string;
area_name: string;
plat_name: string;
partition_name: string;
game_serial: string;
static createFrom(source: any = {}) {
return new GameRole(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.role_id = source["role_id"];
this.role_name = source["role_name"];
this.area_name = source["area_name"];
this.plat_name = source["plat_name"];
this.partition_name = source["partition_name"];
this.game_serial = source["game_serial"];
}
}
export class GameAccount {
open_id: string;
app_id: string;
type: string;
face_url: string;
nick: string;
access_token: string;
extend_info: string;
static createFrom(source: any = {}) {
return new GameAccount(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.open_id = source["open_id"];
this.app_id = source["app_id"];
this.type = source["type"];
this.face_url = source["face_url"];
this.nick = source["nick"];
this.access_token = source["access_token"];
this.extend_info = source["extend_info"];
}
}
export class GameAccountData {
is_bind_account: number;
is_bind_role: number;
is_need_act_check: number;
game_account: GameAccount;
game_role: GameRole;
change_bind_time: number;
static createFrom(source: any = {}) {
return new GameAccountData(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.is_bind_account = source["is_bind_account"];
this.is_bind_role = source["is_bind_role"];
this.is_need_act_check = source["is_need_act_check"];
this.game_account = this.convertValues(source["game_account"], GameAccount);
this.game_role = this.convertValues(source["game_role"], GameRole);
this.change_bind_time = source["change_bind_time"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class CheckUserBindGameAccountResp {
status: number;
msg: string;
account_data: GameAccountData;
game_name: string;
static createFrom(source: any = {}) {
return new CheckUserBindGameAccountResp(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.status = source["status"];
this.msg = source["msg"];
this.account_data = this.convertValues(source["account_data"], GameAccountData);
this.game_name = source["game_name"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class ExchangeInfo {
pid: number;
exchange_score: number;
@@ -357,6 +525,9 @@ export namespace huya {
this.desc = source["desc"];
}
}
export class PrizeTag {
id: number;
name: string;