mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-16 09:58:13 +08:00
🎨 优化分享图片逻辑,能够确认进度了
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @file core utils getGameRecord.ts
|
||||
* @description 获取游戏数据的函数
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
// tauri
|
||||
@@ -13,20 +13,24 @@ import TGUtils from "../utils/TGUtils";
|
||||
|
||||
/**
|
||||
* @description 获取用户游戏数据
|
||||
* @since Alpha v0.2.0
|
||||
* @since Alpha v0.2.1
|
||||
* @description 这边的 ck 可以是 cookie_token 和 account_id
|
||||
* @description 也可以是 ltoken 和 ltuid
|
||||
* @param {Record<string, string>} cookie cookie
|
||||
* @param {TGApp.BBS.Constant.CookieGroup2} cookie cookie
|
||||
* @param {TGApp.Sqlite.Account.Game} user 用户的基本信息
|
||||
* @returns {Promise<TGApp.Game.Record.FullData|TGApp.BBS.Response.Base>} 用户基本信息
|
||||
*/
|
||||
export async function getGameRecord(
|
||||
cookie: Record<string, string>,
|
||||
cookie: TGApp.BBS.Constant.CookieGroup2,
|
||||
user: TGApp.Sqlite.Account.Game,
|
||||
): Promise<TGApp.Game.Record.FullData | TGApp.BBS.Response.Base> {
|
||||
const url = TGApi.GameData.getUserBase;
|
||||
const ck: Record<string, string> = {
|
||||
account_id: cookie.account_id,
|
||||
cookie_token: cookie.cookie_token,
|
||||
};
|
||||
const params = { role_id: user.gameUid, server: user.region };
|
||||
const header = TGUtils.User.getHeader(cookie, "GET", params, "common");
|
||||
const header = TGUtils.User.getHeader(ck, "GET", params, "common");
|
||||
return await http
|
||||
.fetch<TGApp.Game.Record.Response>(url, {
|
||||
method: "GET",
|
||||
|
||||
Reference in New Issue
Block a user