mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
👽️ 修正咨讯Api
This commit is contained in:
@@ -151,7 +151,7 @@ async function firstLoad(key: NewsKey, refresh: boolean = false): Promise<void>
|
||||
}
|
||||
loadingTitle.value = `正在获取${rawData.value[key].name}数据...`;
|
||||
loading.value = true;
|
||||
const getData = await Mys.Post.getNewsList(gid, NewsType[key]);
|
||||
const getData = await Mys.Painter.getNewsList(gid, NewsType[key]);
|
||||
rawData.value[key].isLast = getData.is_last;
|
||||
rawData.value[key].lastId = getData.list.length;
|
||||
postData.value[key] = getData.list;
|
||||
|
||||
@@ -17,6 +17,7 @@ import getPositionCard from "./utils/getPositionCard.js";
|
||||
|
||||
const Mys = {
|
||||
Post,
|
||||
Painter,
|
||||
ApiHub,
|
||||
Gacha: {
|
||||
get: getGachaData,
|
||||
|
||||
@@ -8,6 +8,30 @@ import TGHttp from "../../../utils/TGHttp.js";
|
||||
// MysPainterApiBaseUrl => Mpabu
|
||||
const Mpabu = "https://bbs-api.miyoushe.com/painter/wapi/";
|
||||
|
||||
/**
|
||||
* @description 获取 News 列表
|
||||
* @since Beta v0.6.2
|
||||
* @param {string} gid GID
|
||||
* @param {string} newsType 咨讯类型: 1 为公告,2 为活动,3 为咨讯
|
||||
* @param {number} pageSize 返回数量
|
||||
* @param {number} lastId 上一次请求的最后一条数据的 id
|
||||
* @return {Promise<TGApp.Plugins.Mys.News.FullData>}
|
||||
*/
|
||||
export async function getNewsList(
|
||||
gid: string = "2",
|
||||
newsType: string = "1",
|
||||
pageSize: number = 20,
|
||||
lastId: number = 0,
|
||||
): Promise<TGApp.Plugins.Mys.News.FullData> {
|
||||
return (
|
||||
await TGHttp<TGApp.Plugins.Mys.News.Response>(`${Mpabu}getNewsList`, {
|
||||
method: "GET",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
query: { gids: gid, page_size: pageSize, type: newsType, last_id: lastId },
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取抽奖信息
|
||||
* @since Beta v0.6.2
|
||||
|
||||
@@ -31,30 +31,6 @@ export async function getForumPostList(
|
||||
).data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取 News 列表
|
||||
* @since Beta v0.6.2
|
||||
* @param {string} gid GID
|
||||
* @param {string} newsType 咨讯类型: 1 为公告,2 为活动,3 为咨讯
|
||||
* @param {number} pageSize 返回数量
|
||||
* @param {number} lastId 上一次请求的最后一条数据的 id
|
||||
* @return {Promise<TGApp.Plugins.Mys.News.FullData>}
|
||||
*/
|
||||
export async function getNewsList(
|
||||
gid: string = "2",
|
||||
newsType: string = "1",
|
||||
pageSize: number = 20,
|
||||
lastId: number = 0,
|
||||
): Promise<TGApp.Plugins.Mys.News.FullData> {
|
||||
return (
|
||||
await TGHttp<TGApp.Plugins.Mys.News.Response>(`${Mpabu}getNewsList`, {
|
||||
method: "GET",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
query: { gids: gid, page_size: pageSize, type: newsType, last_id: lastId },
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取单个帖子信息
|
||||
* @since Beta v0.6.2
|
||||
|
||||
Reference in New Issue
Block a user