mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
👽️ 适应 endpoint 变更
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
/**
|
/**
|
||||||
* @file web/request/getGachaLog.ts
|
* @file web/request/getGachaLog.ts
|
||||||
* @description 获取抽卡记录请求函数
|
* @description 获取抽卡记录请求函数
|
||||||
* @since Beta v0.3.0
|
* @since Beta v0.3.5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { http } from "@tauri-apps/api";
|
import { http } from "@tauri-apps/api";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 获取抽卡记录
|
* @description 获取抽卡记录
|
||||||
* @since Beta v0.3.0
|
* @since Beta v0.3.5
|
||||||
* @param {string} authkey authkey
|
* @param {string} authkey authkey
|
||||||
* @param {string} gachaType 抽卡类型
|
* @param {string} gachaType 抽卡类型
|
||||||
* @param {string} endId 结束 id,默认为 0
|
* @param {string} endId 结束 id,默认为 0
|
||||||
@@ -19,7 +19,7 @@ export async function getGachaLog(
|
|||||||
gachaType: string,
|
gachaType: string,
|
||||||
endId: string = "0",
|
endId: string = "0",
|
||||||
): Promise<TGApp.Game.Gacha.GachaItem[] | TGApp.BBS.Response.Base> {
|
): Promise<TGApp.Game.Gacha.GachaItem[] | TGApp.BBS.Response.Base> {
|
||||||
const url = "https://hk4e-api.mihoyo.com/event/gacha_info/api/getGachaLog";
|
const url = "https://public-operation-hk4e.mihoyo.com/gacha_info/api/getGachaLog";
|
||||||
const params = {
|
const params = {
|
||||||
lang: "zh-cn",
|
lang: "zh-cn",
|
||||||
auth_appid: "webview_gacha",
|
auth_appid: "webview_gacha",
|
||||||
@@ -36,7 +36,7 @@ export async function getGachaLog(
|
|||||||
query: params,
|
query: params,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.retcode === 0) return res.data.data.list;
|
if (res.data.retcode !== 0) return res.data;
|
||||||
return res.data;
|
return res.data.data.list;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user