💄 帖子一次刷新12条

This commit is contained in:
目棃
2024-07-25 13:07:46 +08:00
parent 0b8dc2ef60
commit 632576de94
2 changed files with 10 additions and 4 deletions

View File

@@ -202,7 +202,7 @@ async function freshPostData(): Promise<void> {
);
loading.value = true;
loadingTitle.value = `正在加载 ${curGameLabel.value}-${curForumLabel.value}-${curSortLabel.value} 的数据`;
const postsGet = await Mys.Posts.get(curForum.value, curSortType.value);
const postsGet = await Mys.Posts.get(curForum.value, curSortType.value, 12);
posts.value = postsGet.list;
await nextTick();
loading.value = false;

View File

@@ -1,24 +1,30 @@
/**
* @file plugins/Mys/request/getForumList.ts
* @description Mys 插件特定论坛请求
* @since Beta v0.5.0
* @since Beta v0.5.1
*/
import TGHttp from "../../../utils/TGHttp.js";
/**
* @description 获取特定论坛列表
* @since Beta v0.5.0
* @since Beta v0.5.1
* @param {number} forumId 特定论坛 ID
* @param {number} type 排序方式: 0-按热度排序1-最新回复2-按时间排序
* @param {number} page_size 每页数量
* @return {Promise<TGApp.Plugins.Mys.Forum.FullData>}
*/
async function getForumList(
forumId: number,
type: number = 0,
page_size: number = 20,
): Promise<TGApp.Plugins.Mys.Forum.FullData> {
const url = "https://bbs-api.miyoushe.com/post/wapi/getForumPostList";
const params = { forum_id: forumId.toString(), sort_type: type.toString() };
const params = {
forum_id: forumId.toString(),
sort_type: type.toString(),
page_size: page_size.toString(),
};
const resp = await TGHttp<TGApp.Plugins.Mys.Forum.Response>(url, {
method: "GET",
query: params,