mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
✨ 实装祈愿记录获取
This commit is contained in:
@@ -7,10 +7,11 @@
|
||||
|
||||
import { genAuthkey } from "./genAuthkey";
|
||||
import { getAbyss } from "./getAbyss";
|
||||
import { getAnnoList, getAnnoContent } from "./getAnno";
|
||||
import { getAnnoContent, getAnnoList } from "./getAnno";
|
||||
import { getCookieTokenByGameToken, getCookieTokenBySToken } from "./getCookieToken";
|
||||
// import * from "./getEnkaData.ts";
|
||||
import { getGameAccountsBySToken, getGameAccountsByCookie } from "./getGameAccounts";
|
||||
import { getGachaLog } from "./getGachaLog";
|
||||
import { getGameAccountsByCookie, getGameAccountsBySToken } from "./getGameAccounts";
|
||||
import { getGameRecord } from "./getGameRecord";
|
||||
import { getLTokenBySToken } from "./getLToken";
|
||||
import { getGameRoleListByLToken } from "./getRoleList";
|
||||
@@ -28,6 +29,7 @@ const TGRequest = {
|
||||
},
|
||||
User: {
|
||||
getAuthkey: genAuthkey,
|
||||
getGachaLog,
|
||||
getRecord: getGameRecord,
|
||||
byLoginTicket: {
|
||||
getTokens: getTokensByLoginTicket,
|
||||
|
||||
44
src/web/request/getGachaLog.ts
Normal file
44
src/web/request/getGachaLog.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @file web request getGachaLog.ts
|
||||
* @description 获取抽卡记录请求函数
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Beta v0.3.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
/**
|
||||
* @description 获取抽卡记录
|
||||
* @since Beta v0.3.0
|
||||
* @param {string} authkey authkey
|
||||
* @param {string} gachaType 抽卡类型
|
||||
* @param {string} endId 结束 id,默认为 0
|
||||
* @returns {Promise<TGApp.Game.Gacha.GachaItem[] | TGApp.BBS.Response.Base>} 抽卡记录
|
||||
*/
|
||||
export async function getGachaLog(
|
||||
authkey: string,
|
||||
gachaType: string,
|
||||
endId: string = "0",
|
||||
): Promise<TGApp.Game.Gacha.GachaItem[] | TGApp.BBS.Response.Base> {
|
||||
const url = "https://hk4e-api.mihoyo.com/event/gacha_info/api/getGachaLog";
|
||||
const params = {
|
||||
lang: "zh-cn",
|
||||
auth_appid: "webview_gacha",
|
||||
authkey,
|
||||
authkey_ver: "1",
|
||||
sign_type: "2",
|
||||
gacha_type: gachaType,
|
||||
size: "20",
|
||||
end_id: endId,
|
||||
};
|
||||
return await http
|
||||
.fetch<TGApp.Game.Gacha.GachaLogResponse>(url, {
|
||||
method: "GET",
|
||||
query: params,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.data.retcode === 0) return res.data.data.list;
|
||||
return res.data;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user