Skip to content

Commit

Permalink
🐛 修复topic切换分区不生效
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Nov 16, 2024
1 parent 3166567 commit 8f0853c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/pages/common/PostTopic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ async function firstLoad(): Promise<void> {
curGame.value = toRaw(info.game_info_list.find((i) => i.id === curGid.value));
}
if (curGame.value === undefined) curGame.value = info.game_info_list[0];
curGid.value = curGame.value.id;
showLoading.update(`正在加载${curGame.value.name}帖子列表`);
const postList = await Mys.Post.getTopicPostList(gid, topic, curSortType.value);
const postList = await Mys.Post.getTopicPostList(curGid.value, topic, curSortType.value);
if ("retcode" in postList) {
showLoading.end();
showSnackbar.error(`[${postList.retcode}] ${postList.message}`);
Expand All @@ -144,7 +145,12 @@ async function freshPostData(): Promise<void> {
return;
}
showLoading.start("正在加载帖子列表");
const postList = await Mys.Post.getTopicPostList(gid, topic, curSortType.value, lastPostId.value);
const postList = await Mys.Post.getTopicPostList(
curGid.value,
topic,
curSortType.value,
lastPostId.value,
);
if ("retcode" in postList) {
showLoading.end();
showSnackbar.error(`[${postList.retcode}] ${postList.message}`);
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/Mys/request/postReq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ export async function getTopicFullInfo(
/**
* @description 获取特定话题帖子列表
* @since Beta v0.6.3
* @param {string} gid 游戏分区 ID
* @param {number} gid 游戏分区 ID
* @param {string} topicId 话题 ID
* @param {string} orderType 排序方式
* @param {string} lastId 最后一条帖子 ID
* @param {number} size 每页大小
* @return {Promise<TGApp.Plugins.Mys.Topic.PostData|TGApp.BBS.Response.Base>}
*/
export async function getTopicPostList(
gid: string,
gid: number,
topicId: string,
orderType: number = 0,
lastId?: string,
Expand Down

0 comments on commit 8f0853c

Please sign in to comment.