mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
♻️ 抽奖详情做成 overlay
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file plugins Mys interface getLotteryData.ts
|
||||
* @file plugins/Mys/request/getLotteryData.ts
|
||||
* @description Mys 插件抽奖接口
|
||||
* @since Alpha v0.2.1
|
||||
* @since Beta v0.4.5
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
@@ -10,11 +10,13 @@ import MysApi from "../api";
|
||||
|
||||
/**
|
||||
* @description 获取抽奖信息
|
||||
* @since Alpha v0.2.1
|
||||
* @since Beta v0.4.5
|
||||
* @param {string} lotteryId 抽奖 ID
|
||||
* @return {Promise<TGApp.Plugins.Mys.Lottery.FullData>}
|
||||
* @return {Promise<TGApp.BBS.Response.Base|TGApp.Plugins.Mys.Lottery.FullData>}
|
||||
*/
|
||||
async function getLotteryData(lotteryId: string): Promise<TGApp.Plugins.Mys.Lottery.FullData> {
|
||||
async function getLotteryData(
|
||||
lotteryId: string,
|
||||
): Promise<TGApp.BBS.Response.Base | TGApp.Plugins.Mys.Lottery.FullData> {
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Mys.Lottery.Response>(MysApi.Lottery.replace("{lotteryId}", lotteryId), {
|
||||
method: "GET",
|
||||
@@ -23,6 +25,7 @@ async function getLotteryData(lotteryId: string): Promise<TGApp.Plugins.Mys.Lott
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.data.retcode !== 0) return <TGApp.BBS.Response.Base>res.data;
|
||||
return res.data.data.show_lottery;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user