🚸 帖子列表不携带ck

This commit is contained in:
BTMuli
2025-07-15 19:55:45 +08:00
parent 0a534e39e9
commit d25adc11c7
4 changed files with 18 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
/**
* @file request/painterReq.ts
* @description painter 下的请求
* @since Beta v0.7.2
* @since Beta v0.7.9
*/
import { getRequestHeader } from "@utils/getRequestHeader.js";
import TGHttp from "@utils/TGHttp.js";
@@ -35,7 +35,7 @@ async function getNewsList(
/**
* @description 获取最近版块热门帖子列表
* @since Beta v0.7.1
* @since Beta v0.7.9
* @param {number} forumId 版块 ID
* @param {number} gid 社区 ID
* @param {number} pageSize 每页数量
@@ -66,13 +66,14 @@ async function getHotForumPostList(
await TGHttp<TGApp.BBS.Forum.PostForumResp>(`${bapBu}getHotForumPostList`, {
method: "GET",
query: params,
headers: { cookie: "" },
})
).data;
}
/**
* @description 获取最近版块帖子列表
* @since Beta v0.7.1
* @since Beta v0.7.9
* @param {number} forumId 版块 ID
* @param {number} gid 社区 ID
* @param {number} type 排序方式: 1-最新回复2-最新发布
@@ -107,6 +108,7 @@ async function getRecentForumPostList(
await TGHttp<TGApp.BBS.Forum.PostForumResp>(`${bapBu}getRecentForumPostList`, {
method: "GET",
query: params,
headers: { cookie: "" },
})
).data;
}

View File

@@ -12,7 +12,7 @@ const Referer: Readonly<string> = "https://bbs.mihoyo.com/";
/**
* @description 获取单个帖子信息
* @since Beta v0.7.7
* @since Beta v0.7.9
* @param {number|string} postId 帖子 ID
* @param {Record<string, string>} cookie Cookie
* @return {Promise<TGApp.BBS.Post.FullData | TGApp.BBS.Response.Base>}
@@ -28,7 +28,7 @@ async function getPostFull(
...getRequestHeader(cookie, "GET", param, "K2", true),
"x-rpc-client_type": "2",
};
} else header = { referer: Referer };
} else header = { referer: Referer, cookie: "" };
const resp = await TGHttp<TGApp.BBS.Post.FullResp>(`${bapBu}getPostFull`, {
method: "GET",
headers: header,
@@ -40,7 +40,7 @@ async function getPostFull(
/**
* @description 获取合集帖子
* @since Beta v0.7.1
* @since Beta v0.7.9
* @param {string} collectionId 合集 ID
* @returns {Promise<Array<TGApp.BBS.Post.FullData>>}
*/
@@ -50,7 +50,7 @@ async function getPostFullInCollection(
return (
await TGHttp<TGApp.BBS.Collection.PostsResp>(`${bapBu}getPostFullInCollection`, {
method: "GET",
headers: { "Content-Type": "application/json", referer: Referer },
headers: { "Content-Type": "application/json", referer: Referer, cookie: "" },
query: { collection_id: collectionId },
})
).data.posts;

View File

@@ -1,7 +1,7 @@
/**
* @file web/request/topicReq.ts
* @description 话题相关的请求
* @since Beta v0.7.1
* @since Beta v0.7.9
*/
import TGHttp from "@utils/TGHttp.js";
@@ -11,7 +11,7 @@ const Referer: Readonly<string> = "https://bbs.mihoyo.com/";
/**
* @description 获取特定话题信息
* @since Beta v0.7.1
* @since Beta v0.7.9
* @param {string} gid 游戏分区 ID
* @param {string} topicId 话题 ID
* @return {Promise<TGApp.BBS.Topic.InfoRes|TGApp.BBS.Response.Base>}
@@ -22,7 +22,7 @@ async function getTopicFullInfo(
): Promise<TGApp.BBS.Topic.InfoRes | TGApp.BBS.Response.Base> {
const resp = await TGHttp<TGApp.BBS.Topic.InfoResp>(`${batBu}getTopicFullInfo`, {
method: "GET",
headers: { referer: Referer },
headers: { referer: Referer, cookie: "" },
query: { gids: gid, id: topicId },
});
if (resp.retcode !== 0) return <TGApp.BBS.Response.Base>resp;

View File

@@ -1,7 +1,7 @@
/**
* @file utils/TGBbs.ts
* @description 关于 BBS 的工具函数
* @since Beta v0.7.7
* @since Beta v0.7.9
*/
/**
@@ -10,18 +10,18 @@
*/
export type SaltKey = "K2" | "LK2" | "X4" | "X6" | "PROD";
const BBS_VERSION: Readonly<string> = "2.87.0";
const BBS_VERSION: Readonly<string> = "2.90.0";
const BBS_UA_MOBILE: Readonly<string> = `Mozilla/5.0 (Linux; Android 12) Mobile miHoYoBBS/${BBS_VERSION}`;
const BBS_UA_PC: Readonly<string> = `Mozilla/5.0 (Windows NT 10.0; Win64; x64) miHoYoBBS/${BBS_VERSION}`;
/**
* @description salt 值
* @version 2.87.0
* @since Beta v0.7.7
* @version 2.90.0
* @since Beta v0.7.9
*/
const BBS_SALT: Readonly<Record<SaltKey, string>> = {
K2: "pleAwRHEIvtzvECEdmdTsEhqlbWLDrRR",
LK2: "XixTFUuRvcKZzgzqHPPoBVzUgYufetsa",
K2: "LKsbRciURVKljyjuhSeobiyFngbAyjAh",
LK2: "dDIQHbKOdaPaLuvQKVzUzqdeCaxjtaPV",
X4: "xV8v4Qu54lUKrEYFZkJhB8cuOh9Asafs",
X6: "t0qEgfub6cvueAPgR5m9aQWWVciEer7v",
PROD: "t0qEgfub6cvueAPgR5m9aQWWVciEer7v",