mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
🏷️ fix(types): 精简 types,清除无用文件
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* @file plugins Mys request calendar.ts
|
||||
* @description Mys 插件日历请求
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.1.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
import { type CalendarResponse, type CalendarData } from "../interface/calendar";
|
||||
|
||||
// 日历 API
|
||||
const CALENDAR_API = "https://api-static.mihoyo.com/common/blackboard/ys_obc/v1/get_activity_calendar?app_sn=ys_obc";
|
||||
|
||||
/**
|
||||
* @description 日历请求
|
||||
* @since Alpha v0.1.1
|
||||
* @return {Promise<CalendarData[]>}
|
||||
*/
|
||||
export async function getCalendarData (): Promise<CalendarData[]> {
|
||||
const res = await http
|
||||
.fetch<CalendarResponse>(CALENDAR_API, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data.data.list;
|
||||
});
|
||||
return res.filter((item) => item.kind === "2");
|
||||
}
|
||||
Reference in New Issue
Block a user