💡 v0.6.10 → v0.7.0

This commit is contained in:
目棃
2025-02-26 10:10:36 +08:00
parent beb457a884
commit c25bde1b7a
11 changed files with 41 additions and 43 deletions

View File

@@ -1,7 +1,7 @@
/**
* @file plugins/Mys/request/postReq.ts
* @description 帖子相关的获取
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
*/
import TGHttp from "@/utils/TGHttp.js";
@@ -15,7 +15,7 @@ const Referer: Readonly<string> = "https://bbs.mihoyo.com/";
/**
* @description 获取单个帖子信息
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @param {number} postId 帖子 ID
* @param {Record<string, string>} cookie Cookie
* @return {Promise<TGApp.Plugins.Mys.Post.FullData|TGApp.BBS.Response.Base>}

View File

@@ -1,7 +1,7 @@
/**
* @file plugins/Sqlite/modules/avatarBirth.ts
* @description 角色生日模块
* @since Beta v0.6.10
* @since Beta v0.7.0
*/
import { AppCharacterData, ArcBirCalendar, ArcBirRole, WikiCharacterData } from "@/data/index.js";
@@ -43,7 +43,7 @@ function isLeapYear(year: number): boolean {
/**
* @description 获取下一个角色生日
* @since Beta v0.6.10
* @since Beta v0.7.0
* @param {[number,number]} date - 日期
* @return {TGApp.Archive.Birth.RoleItem[]} 下一个角色生日
*/

View File

@@ -1,7 +1,7 @@
/**
* @file router modules user.ts
* @description user 路由模块
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
*/
import type { RouteRecordRaw } from "vue-router";

View File

@@ -1,7 +1,7 @@
/**
* @file types/BBS/Mission.d.ts
* @description BBS 任务相关类型定义文件
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
*/
declare namespace TGApp.BBS.Mission {
@@ -9,7 +9,7 @@ declare namespace TGApp.BBS.Mission {
* @description 任务信息返回
* @interface InfoResp
* @extends TGApp.BBS.Response.BaseWithData
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @property {TGApp.BBS.Mission.InfoRes} data 任务信息
* @return InfoResp
*/
@@ -18,7 +18,7 @@ declare namespace TGApp.BBS.Mission {
/**
* @description 任务信息
* @interface InfoRes
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @property {Array<MissionItem>} missions 任务列表
* @property {Array<MissionItem>} more_missions 更多任务列表
* @return InfoRes
@@ -28,7 +28,7 @@ declare namespace TGApp.BBS.Mission {
/**
* @description 任务项
* @interface MissionItem
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @property {number} id 任务 ID
* @property {string} name 任务名称
* @property {string} desc 任务描述
@@ -64,7 +64,7 @@ declare namespace TGApp.BBS.Mission {
* @description 任务状态返回
* @interface StateResp
* @extends TGApp.BBS.Response.BaseWithData
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @property {TGApp.BBS.Mission.StateRes} data 任务状态
* @return StateResp
*/
@@ -73,7 +73,7 @@ declare namespace TGApp.BBS.Mission {
/**
* @description 任务状态
* @interface StateRes
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @property {Array<StateItem>} states 任务状态列表
* @property {number} already_received_points 已领取的米游币
* @property {number} total_points 总米游币
@@ -94,7 +94,7 @@ declare namespace TGApp.BBS.Mission {
/**
* @description 任务状态项
* @interface StateItem
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @property {number} mission_id 任务 ID
* @property {number} process 任务进度 0未完成1已完成
* @property {number} happened_times 发生次数

View File

@@ -1,7 +1,7 @@
/**
* @file utils/TGBbs.ts
* @description 关于 BBS 的工具函数
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
*/
const BBS_VERSION: Readonly<string> = "2.82.0";

View File

@@ -1,7 +1,7 @@
/**
* @file utils/TGLogger.ts
* @description 日志工具
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
*/
import { event } from "@tauri-apps/api";
@@ -77,7 +77,7 @@ class Logger {
/**
* @description 输出日志-脚本
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @param {string} message 日志信息
* @returns {Promise<void>} 无返回值
*/
@@ -89,7 +89,7 @@ class Logger {
/**
* @description 输出日志-脚本分隔符
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @param {string} label 标签
* @param {boolean} [start] 是否为开始,默认为 true
* @returns {Promise<void>} 无返回值

View File

@@ -1,7 +1,7 @@
/**
* @file web/request/apiHubReq.ts
* @description apiHub下的请求
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
*/
import TGHttp from "@/utils/TGHttp.js";
@@ -41,7 +41,7 @@ async function getGameList(): Promise<Array<TGApp.BBS.Game.Item>> {
/**
* @description 获取用户米游币任务完成情况
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @param {Record<string,string>} cookie 用户 Cookie
* @return {Promise<TGApp.BBS.Mission.InfoRes>}
*/
@@ -55,7 +55,7 @@ async function getMissions(cookie: Record<string, string>): Promise<TGApp.BBS.Mi
/**
* @description 获取分享配置
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @description **需要验证码登录返回的 Cookie**
* @param {string} postId 帖子 ID
* @param {Record<string,string>} cookie 用户 Cookie
@@ -79,7 +79,7 @@ async function getShareConf(
/**
* @description 获取任务完成情况
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @description **需要验证码登录的 Cookie**
* @param {Record<string,string>} cookie 用户 Cookie
* @return {Promise<TGApp.BBS.Mission.StateResp>}
@@ -146,7 +146,7 @@ async function homeNew(gid: number = 2): Promise<TGApp.BBS.Navigator.Navigator[]
/**
* @description 签到
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @description **需要验证码登录获取的 Cookie**
* @param {Record<string,string>} cookie 用户 Cookie
* @param {string} gid
@@ -170,7 +170,7 @@ async function signIn(
/**
* @description 点赞
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
* @param {string} id 帖子 ID
* @param {Record<string,string>} cookie 用户 Cookie
* @param {boolean} cancel 是否取消点赞

View File

@@ -1,15 +1,13 @@
/**
* @file web/request/takumiReq.ts
* @description Takumi 相关请求函数
* @since Beta v0.6.3
* @since Beta v0.7.0
*/
import TGHttp from "@/utils/TGHttp.js";
import { getRequestHeader } from "@/web/utils/getRequestHeader.js";
// TakumiAuthApiBaseUrl => taAbu
const taAbu: Readonly<string> = "https://api-takumi.mihoyo.com/auth/api/";
// TakumiBingApiBaseUrl => tbAbu
const tbAbu: Readonly<string> = "https://api-takumi.mihoyo.com/binding/api/";
// TakumiApiBaseUrl => taBu
const taBu: Readonly<string> = "https://api-takumi.mihoyo.com/";
/**
* @description 根据stoken获取action_ticket
@@ -26,7 +24,7 @@ async function getActionTicketBySToken(
): Promise<ActionTicketByStokenResp> {
const ck = { stoken: cookie.stoken, mid: cookie.mid };
const params = { action_type: actionType, stoken: cookie.stoken, uid: user.gameUid };
return await TGHttp<ActionTicketByStokenResp>(`${taAbu}getActionTicketBySToken`, {
return await TGHttp<ActionTicketByStokenResp>(`${taBu}auth/api/getActionTicketBySToken`, {
method: "GET",
headers: getRequestHeader(ck, "GET", params, "K2"),
query: params,
@@ -52,7 +50,7 @@ async function genAuthKey(
region: account.region,
};
const resp = await TGHttp<TGApp.Game.Gacha.AuthkeyResponse | TGApp.BBS.Response.Base>(
`${tbAbu}genAuthKey`,
`${taBu}binding/api/genAuthKey`,
{
method: "POST",
headers: getRequestHeader(ck, "POST", JSON.stringify(data), "LK2", true),
@@ -74,7 +72,7 @@ async function genAuthKey2(
cookie: Record<string, string>,
payload: Record<string, string>,
): Promise<TGApp.BBS.Response.Base> {
return await TGHttp<TGApp.BBS.Response.Base>(`${tbAbu}genAuthKey`, {
return await TGHttp<TGApp.BBS.Response.Base>(`${taBu}binding/api/genAuthKey`, {
method: "POST",
headers: getRequestHeader(cookie, "POST", JSON.stringify(payload), "LK2", true),
body: JSON.stringify(payload),
@@ -92,7 +90,7 @@ async function getUserGameRolesByCookie(
): Promise<TGApp.BBS.Account.GameAccount[] | TGApp.BBS.Response.Base> {
const ck = { account_id: cookie.account_id, cookie_token: cookie.cookie_token };
const params = { game_biz: "hk4e_cn" };
const resp = await TGHttp<GameAccountsResp>(`${tbAbu}getUserGameRolesByCookie`, {
const resp = await TGHttp<GameAccountsResp>(`${taBu}binding/api/getUserGameRolesByCookie`, {
method: "GET",
headers: getRequestHeader(ck, "GET", params),
query: params,

View File

@@ -1,7 +1,7 @@
/**
* @file web/utils/annoParser.ts
* @description 解析游戏内公告数据
* @since Beta v0.6.10
* @since Beta v0.7.0
*/
import TpText from "@comp/viewPost/tp-text.vue";
@@ -27,7 +27,7 @@ function handleAnnoTable(table: HTMLTableElement): HTMLTableElement {
/**
* @description 预处理公告内容
* @since Beta v0.6.10
* @since Beta v0.7.0
* @param {string} data 游戏内公告数据
* @returns {string} 解析后的数据
*/
@@ -57,7 +57,7 @@ function parseAnnoContent(
/**
* @description 解析公告节点
* @since Beta v0.6.10
* @since Beta v0.7.0
* @param {Node} node - 节点
* @param {Record<string, string>} attr - 属性
* @returns {TGApp.Plugins.Mys.SctPost.Base} 结构化数据
@@ -142,7 +142,7 @@ function parseAnnoNode(
/**
* @description 解析公告段落
* @since Beta v0.6.10
* @since Beta v0.7.0
* @param {HTMLElement} p - 段落元素
* @param {Record<string, string>} attr - 属性
* @returns {TGApp.Plugins.Mys.SctPost.Base} 结构化数据
@@ -224,7 +224,7 @@ function parseAnnoParagraph(
/**
* @description 解析公告 span
* @since Beta v0.6.10
* @since Beta v0.7.0
* @param {HTMLElement} span - span 元素
* @param {Record<string, string>} attr - 属性
* @returns {TGApp.Plugins.Mys.SctPost.Base} 结构化数据
@@ -279,7 +279,7 @@ function parseAnnoSpan(
/**
* @description 解析公告图片
* @since Beta v0.6.10
* @since Beta v0.7.0
* @param {HTMLElement} img - 图片元素
* @returns {TGApp.Plugins.Mys.SctPost.Base} 结构化数据
*/
@@ -302,7 +302,7 @@ function parseAnnoImage(img: HTMLElement): TGApp.Plugins.Mys.SctPost.Base {
/**
* @description 解析公告锚点
* @since Beta v0.6.10
* @since Beta v0.7.0
* @param {HTMLElement} a - 锚点元素
* @returns {TGApp.Plugins.Mys.SctPost.Base} 结构化数据
*/
@@ -331,7 +331,7 @@ function parseAnnoAnchor(a: HTMLElement): TGApp.Plugins.Mys.SctPost.Base {
/**
* @description 解析公告详情
* @since Beta v0.6.10
* @since Beta v0.7.0
* @param {HTMLElement} details - 详情元素
* @returns {TGApp.Plugins.Mys.SctPost.Base} 结构化数据
*/
@@ -366,7 +366,7 @@ function parseAnnoDetails(details: HTMLElement): TGApp.Plugins.Mys.SctPost.Base
/**
* @description 解析公告表格
* @since Beta v0.6.10
* @since Beta v0.7.0
* @param {HTMLElement} table - 表格元素
* @returns {TGApp.Plugins.Mys.SctPost.Base} 结构化数据
*/

View File

@@ -1,7 +1,7 @@
/**
* @file web/utils/getRequestHeader.ts
* @description 获取请求头
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
*/
import Md5 from "js-md5";
@@ -25,7 +25,7 @@ const enum SaltType {
/**
* @description salt 值
* @version 2.82.0
* @since Beta v0.6.10/v0.7.0
* @since Beta v0.7.0
*/
const Salt: Readonly<Record<keyof typeof SaltType, string>> = {
K2: "RGcLwIWYOQwTQPJ8Qw41kioel738ch3Z",