From 5834eee6fc6eee7ad26ee0e2d6c83fb3aad74c4a Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sun, 4 Jan 2026 15:38:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=B8=96=E5=AD=90=E8=8E=B7=E5=8F=96=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/client/mod.rs | 4 ++-- src/request/postReq.ts | 15 ++++++--------- src/utils/TGBbs.ts | 14 +++++++------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src-tauri/src/client/mod.rs b/src-tauri/src/client/mod.rs index 811d1407..ada0c389 100644 --- a/src-tauri/src/client/mod.rs +++ b/src-tauri/src/client/mod.rs @@ -1,6 +1,6 @@ //! @file src/client/mod.rs //! @desc 客户端模块,负责操作米游社客户端 -//! @since Beta v0.8.0 +//! @since Beta v0.9.1 mod menu; mod utils; @@ -8,7 +8,7 @@ mod utils; use tauri::{AppHandle, Manager, WebviewWindowBuilder}; use tauri_utils::config::WebviewUrl; -static BBS_VERSION: &'static str = "2.95.1"; +static BBS_VERSION: &'static str = "2.99.1"; #[tauri::command] pub async fn create_mhy_client(handle: AppHandle, func: String, url: String) { diff --git a/src/request/postReq.ts b/src/request/postReq.ts index 178536f9..9756bc0f 100644 --- a/src/request/postReq.ts +++ b/src/request/postReq.ts @@ -1,6 +1,6 @@ /** * 帖子相关的请求 - * @since Beta v0.8.7 + * @since Beta v0.9.1 */ import { getRequestHeader } from "@utils/getRequestHeader.js"; import TGHttp from "@utils/TGHttp.js"; @@ -11,7 +11,7 @@ const Referer: Readonly = "https://bbs.mihoyo.com/"; /** * 获取单个帖子信息 - * @since Beta v0.7.9 + * @since Beta v0.9.1 * @param postId - 帖子 ID * @param cookie - Cookie * @returns 帖子信息 @@ -21,13 +21,10 @@ async function getPostFull( cookie?: Record, ): Promise { const param = { post_id: postId, read: 1 }; - let header; - if (cookie !== undefined) { - header = { - ...getRequestHeader(cookie, "GET", param, "K2", true), - "x-rpc-client_type": "2", - }; - } else header = { referer: Referer, cookie: "" }; + const header = { + ...getRequestHeader(cookie ?? {}, "GET", param, "K2", true), + "x-rpc-client_type": "2", + }; const resp = await TGHttp(`${bapBu}getPostFull`, { method: "GET", headers: header, diff --git a/src/utils/TGBbs.ts b/src/utils/TGBbs.ts index e3a0c819..68e231eb 100644 --- a/src/utils/TGBbs.ts +++ b/src/utils/TGBbs.ts @@ -1,26 +1,26 @@ /** * 关于 BBS 的工具函数 - * @since Beta v0.8.4 + * @since Beta v0.9.1 */ /** * salt 类型 - * @since Beta v0.8.4 + * @since Beta v0.9.1 */ export type SaltKey = "K2" | "LK2" | "X4" | "X6" | "PROD"; -const BBS_VERSION: Readonly = "2.95.1"; +const BBS_VERSION: Readonly = "2.99.1"; const BBS_UA_MOBILE: Readonly = `Mozilla/5.0 (Linux; Android 12) Mobile miHoYoBBS/${BBS_VERSION}`; const BBS_UA_PC: Readonly = `Mozilla/5.0 (Windows NT 10.0; Win64; x64) miHoYoBBS/${BBS_VERSION}`; /** * salt 值 - * @since Beta v0.8.4 - * @remarks 2.95.1 + * @since Beta v0.9.1 + * @remarks 2.99.1 */ const BBS_SALT: Readonly> = { - K2: "sfYPEgpxkOe1I3XVMLdwp1Lyt9ORgZsq", - LK2: "sidQFEglajEz7FA0Aj7HQPV88zpf17SO", + K2: "b0EofkfMKq2saWV9fwux18J5vzcFTlex", + LK2: "DlOUwIupfU6YespEUWDJmXtutuXV6owG", X4: "xV8v4Qu54lUKrEYFZkJhB8cuOh9Asafs", X6: "t0qEgfub6cvueAPgR5m9aQWWVciEer7v", PROD: "t0qEgfub6cvueAPgR5m9aQWWVciEer7v",