diff --git a/src/plugins/Mys/request/doGameLogin.ts b/src/plugins/Mys/request/doGameLogin.ts index b3020279..3da3afea 100644 --- a/src/plugins/Mys/request/doGameLogin.ts +++ b/src/plugins/Mys/request/doGameLogin.ts @@ -1,11 +1,10 @@ /** - * @file plugins Mys utils doGameLogin + * @file plugins/Mys/utils/doGameLogin + * @todo 完善 * @description 获取 gameToken,曲线获取 stoken - * @author BTMuli * @since Beta v0.3.0 */ -// tauri import { http } from "@tauri-apps/api"; const device = crypto.randomUUID(); @@ -13,10 +12,10 @@ const device = crypto.randomUUID(); /** * @description 获取登录二维码 * @since Beta v0.3.0 - * @returns {Promise} + * @returns {Promise} */ export async function getLoginQr(): Promise< - TGApp.Plugins.Mys.GameLogin.GetLoginQrData | TGApp.Plugins.Mys.Base.Response + TGApp.Plugins.Mys.GameLogin.GetLoginQrData | TGApp.BBS.Response.Base > { const url = "https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/fetch"; const data = { @@ -24,7 +23,7 @@ export async function getLoginQr(): Promise< device, }; return await http - .fetch(url, { + .fetch(url, { method: "POST", body: http.Body.json(data), }) @@ -38,16 +37,16 @@ export async function getLoginQr(): Promise< * @description 获取登录状态 * @since Beta v0.3.0 * @param {string} ticket 二维码 ticket - * @returns {Promise} + * @returns {Promise} */ export async function getLoginStatus( ticket: string, -): Promise { +): Promise { const url = "https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/query"; const data = { app_id: "4", device, ticket }; console.log(data); return await http - .fetch(url, { + .fetch(url, { method: "POST", body: http.Body.json(data), }) diff --git a/src/plugins/Mys/request/getEmojis.ts b/src/plugins/Mys/request/getEmojis.ts index 42eca606..7e760ba1 100644 --- a/src/plugins/Mys/request/getEmojis.ts +++ b/src/plugins/Mys/request/getEmojis.ts @@ -1,11 +1,9 @@ /** - * @file plugins Mys request getEmojis.ts + * @file plugins/Mys/request/getEmojis.ts * @description Mys 表情包请求函数集合 - * @author BTMuli * @since Beta v0.3.0 */ -// tauri import { http } from "@tauri-apps/api"; /** @@ -15,16 +13,18 @@ import { http } from "@tauri-apps/api"; */ export async function getEmojis(): Promise | TGApp.BBS.Response.Base> { const url = "https://bbs-api-static.miyoushe.com/misc/api/emoticon_set"; - return await http.fetch(url).then((res) => { - if (res.data.retcode === 0) { - const emojis: Record = {}; - res.data.data.list.forEach((series) => { - series.list.forEach((emoji) => { - emojis[emoji.name] = emoji.icon; + return await http + .fetch(url) + .then((res) => { + if (res.data.retcode === 0) { + const emojis: Record = {}; + res.data.data.list.forEach((series) => { + series.list.forEach((emoji) => { + emojis[emoji.name] = emoji.icon; + }); }); - }); - return emojis; - } - return res.data; - }); + return emojis; + } + return res.data; + }); } diff --git a/src/plugins/Mys/types/Base.d.ts b/src/plugins/Mys/types/Base.d.ts deleted file mode 100644 index a3fa69e4..00000000 --- a/src/plugins/Mys/types/Base.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file plugins Mys types Base.d.ts - * @description Mys 插件基础类型定义文件 - * @author BTMuli - * @since Alpha v0.2.1 - */ - -/** - * @description Mys 插件基础类型 - * @since Alpha v0.2.1 - * @namespace Base - * @return Base - */ -declare namespace TGApp.Plugins.Mys.Base { - /** - * @description Mys Response 统一接口 - * @since Alpha v0.2.1 - * @interface Response - * @property {number} retcode 状态码 - * @property {string} message 状态信息 - * @property {any} data 数据 - * @return Response - */ - export interface Response { - retcode: number; - message: string; - data: any; - } -} diff --git a/src/plugins/Mys/types/Emoji.d.ts b/src/plugins/Mys/types/Emoji.d.ts index fc92e4fa..6458ff5b 100644 --- a/src/plugins/Mys/types/Emoji.d.ts +++ b/src/plugins/Mys/types/Emoji.d.ts @@ -1,27 +1,27 @@ /** - * @file plugins Mys types Emoji.d.ts + * @file plugins/Mys/types/Emoji.d.ts * @description Mys 表情包类型声明文件 - * @author BTMuli * @since Beta v0.3.0 */ /** * @description Mys 表情包类型 * @since Beta v0.3.0 - * @namespace Emoji - * return Emoji + * @namespace TGApp.Plugins.Mys.Emoji + * @memberof TGApp.Plugins.Mys */ declare namespace TGApp.Plugins.Mys.Emoji { /** * @description 获取表情包列表返回 * @since Beta v0.3.0 * @interface Response - * @extends TGApp.Plugins.Mys.Base.Response + * @extends TGApp.BBS.Response.Base * @property {Series[]} data.list 表情包列表 * @property {unknown} data.recently_emoticon 最近使用的表情包 * @return Response */ - export interface Response extends TGApp.Plugins.Mys.Base.Response { + interface Response extends TGApp.BBS.Response.Base { + retcode: 0; data: { list: Series[]; recently_emoticon: unknown; @@ -43,7 +43,7 @@ declare namespace TGApp.Plugins.Mys.Emoji { * @property {boolean} is_available 表情包系列是否可用 * @return Series */ - export interface Series { + interface Series { id: number; name: string; icon: string; @@ -70,7 +70,7 @@ declare namespace TGApp.Plugins.Mys.Emoji { * @property {unknown[]} keywords 表情包关键词 * @return EmojiItem */ - export interface EmojiItem { + interface EmojiItem { id: number; name: string; icon: string; diff --git a/src/plugins/Mys/types/Gacha.d.ts b/src/plugins/Mys/types/Gacha.d.ts index de80e51b..6c507f03 100644 --- a/src/plugins/Mys/types/Gacha.d.ts +++ b/src/plugins/Mys/types/Gacha.d.ts @@ -1,5 +1,5 @@ /** - * @file plugins Mys types Gacha.d.ts + * @file plugins/Mys/types/Gacha.d.ts * @description Mys 插件卡池类型定义文件 * @since Beta v0.3.3 */ @@ -7,19 +7,20 @@ /** * @description Mys 卡池类型定义 * @since Beta v0.3.3 - * @namespace Gacha - * @return Gacha + * @namespace TGApp.Plugins.Mys.Gacha + * @memberof TGApp.Plugins.Mys */ declare namespace TGApp.Plugins.Mys.Gacha { /** * @description 获取卡池信息返回 * @since Alpha v0.2.1 * @interface Response - * @extends TGApp.Plugins.Mys.Base.Response + * @extends TGApp.BBS.Response.Base * @property {Data[]} data.list 卡池数据 * @return Response */ - interface Response extends TGApp.Plugins.Mys.Base.Response { + interface Response extends TGApp.BBS.Response.Base { + retcode: 0; data: { list: Data[]; }; diff --git a/src/plugins/Mys/types/GameLogin.d.ts b/src/plugins/Mys/types/GameLogin.d.ts index 00edd38a..ef49a264 100644 --- a/src/plugins/Mys/types/GameLogin.d.ts +++ b/src/plugins/Mys/types/GameLogin.d.ts @@ -1,26 +1,26 @@ /** - * @file plugins Mys types GameLogin.d.ts + * @file plugins/Mys/types/GameLogin.d.ts * @description Mys 插件 Game 登录类型定义文件 - * @author BTMuli * @since Beta v0.3.0 */ /** * @description Mys 插件 Game 登录类型 * @since Beta v0.3.0 - * @namespace GameLogin - * @return GameLogin + * @namespace TGApp.Plugins.Mys.GameLogin + * @memberof TGApp.Plugins.Mys */ declare namespace TGApp.Plugins.Mys.GameLogin { /** * @description 获取登录二维码返回数据 * @since Beta v0.3.0 * @interface GetLoginQrResponse - * @extends TGApp.Plugins.Mys.Base.Response + * @extends TGApp.BBS.Response.Base * @property {GetLoginQrData} data 数据 * @return GetLoginQrResponse */ - export interface GetLoginQrResponse extends TGApp.Plugins.Mys.Base.Response { + interface GetLoginQrResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: GetLoginQrData; } @@ -31,7 +31,7 @@ declare namespace TGApp.Plugins.Mys.GameLogin { * @property {string} url 二维码链接 * @return GetLoginQrData */ - export interface GetLoginQrData { + interface GetLoginQrData { url: string; } @@ -39,11 +39,12 @@ declare namespace TGApp.Plugins.Mys.GameLogin { * @description 获取登录状态返回数据 * @since Beta v0.3.0 * @interface GetLoginStatusResponse - * @extends TGApp.Plugins.Mys.Base.Response + * @extends TGApp.BBS.Response.Base * @property {GetLoginStatusData} data 数据 * @return GetLoginStatusResponse */ - export interface GetLoginStatusResponse extends TGApp.Plugins.Mys.Base.Response { + interface GetLoginStatusResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: GetLoginStatusData; } @@ -55,7 +56,7 @@ declare namespace TGApp.Plugins.Mys.GameLogin { * @property {StatusPayload} payload 状态数据 * @return GetLoginStatusData */ - export interface GetLoginStatusData { + interface GetLoginStatusData { stat: string; payload: StatusPayload; } @@ -69,7 +70,7 @@ declare namespace TGApp.Plugins.Mys.GameLogin { * @property {string} raw 序列化数据,反序列化后是 {uid: string, token: string} * @return StatusPayload */ - export interface StatusPayload { + interface StatusPayload { ext: string; proto: string; raw: string; @@ -83,7 +84,7 @@ declare namespace TGApp.Plugins.Mys.GameLogin { * @property {string} token 用户 token * @return StatusPayloadRaw */ - export interface StatusPayloadRaw { + interface StatusPayloadRaw { uid: string; token: string; } diff --git a/src/plugins/Mys/types/Lottery.d.ts b/src/plugins/Mys/types/Lottery.d.ts index 667200e1..22da303e 100644 --- a/src/plugins/Mys/types/Lottery.d.ts +++ b/src/plugins/Mys/types/Lottery.d.ts @@ -1,26 +1,26 @@ /** - * @file plugins Mys types Lottery.d.ts + * @file plugins/Mys/types/Lottery.d.ts * @description Mys 插件抽奖类型定义文件 - * @author BTMuli * @since Alpha v0.2.1 */ /** * @description Mys 插件抽奖类型 * @since Alpha v0.2.1 - * @namespace Lottery - * @return Lottery + * @namespace TGApp.Plugins.Mys.Lottery + * @memberof TGApp.Plugins.Mys */ declare namespace TGApp.Plugins.Mys.Lottery { /** * @description 抽奖返回数据 * @since Alpha v0.2.1 * @interface Response - * @extends TGApp.Plugins.Mys.Base.Response; + * @extends TGApp.BBS.Response.Base * @property {FullData} data.show_lottery 抽奖数据 * @return Response */ - export interface Response extends TGApp.Plugins.Mys.Base.Response { + interface Response extends TGApp.BBS.Response.Base { + retcode: 0; data: { show_lottery: FullData; }; @@ -47,7 +47,7 @@ declare namespace TGApp.Plugins.Mys.Lottery { * @property {string} now_time 当前时间 * @return FullData */ - export interface FullData { + interface FullData { id: string; creator: TGApp.Plugins.Mys.User.Post; draw_time: string; @@ -77,7 +77,7 @@ declare namespace TGApp.Plugins.Mys.Lottery { * @property {string} id 奖励 ID * @return Reward */ - export interface Reward { + interface Reward { reward_name: string; winner_number: number; scheduled_winner_number: number; @@ -98,7 +98,7 @@ declare namespace TGApp.Plugins.Mys.Lottery { * @property {RenderReward[]} rewards 奖励列表 * @return RenderCard */ - export interface RenderCard { + interface RenderCard { id: string; upWay: string; status: string; @@ -117,7 +117,7 @@ declare namespace TGApp.Plugins.Mys.Lottery { * @property {TGApp.Plugins.Mys.User.Post[]} users 用户列表 * @return RenderReward */ - export interface RenderReward { + interface RenderReward { name: string; win: number; goal: number; diff --git a/src/plugins/Mys/types/News.d.ts b/src/plugins/Mys/types/News.d.ts index 794accba..9ac31286 100644 --- a/src/plugins/Mys/types/News.d.ts +++ b/src/plugins/Mys/types/News.d.ts @@ -1,26 +1,26 @@ /** - * @file plugins Mys types news.d.ts + * @file plugins/Mys/types/news.d.ts * @description Mys 插件咨讯类型定义文件 - * @author BTMuli * @since Alpha v0.2.1 */ /** * @description Mys 插件咨讯类型 * @since Alpha v0.2.1 - * @namespace News - * @return News + * @namespace TGApp.Plugins.Mys.News + * @memberof TGApp.Plugins.Mys */ declare namespace TGApp.Plugins.Mys.News { /** * @description 咨讯返回数据 * @since Alpha v0.2.1 * @interface Response - * @extends TGApp.Plugins.Mys.Base.Response + * @extends TGApp.BBS.Response.Base * @property {FullData} data 咨讯数据 * @return Response */ - export interface Response extends TGApp.Plugins.Mys.Base.Response { + interface Response extends TGApp.BBS.Response.Base { + retcode: 0; data: FullData; } @@ -33,7 +33,7 @@ declare namespace TGApp.Plugins.Mys.News { * @property {Item[]} list 咨讯列表 * @return FullData */ - export interface FullData { + interface FullData { last_id: number; is_last: boolean; list: Item[]; @@ -66,7 +66,7 @@ declare namespace TGApp.Plugins.Mys.News { * @property {Meta} news_meta 元数据 * @returns Item */ - export interface Item { + interface Item { post: TGApp.Plugins.Mys.Post.Post; forum: TGApp.Plugins.Mys.Post.Forum; topics: TGApp.Plugins.Mys.Post.Topic[]; @@ -99,7 +99,7 @@ declare namespace TGApp.Plugins.Mys.News { * @property {string} end_at_sec 活动结束时间戳,单位秒 * @return Meta */ - export interface Meta { + interface Meta { activity_status: number; start_at_sec: string; end_at_sec: string; @@ -130,7 +130,7 @@ declare namespace TGApp.Plugins.Mys.News { * @property {number} data.view 帖子浏览数 * @return RenderCard */ - export interface RenderCard { + interface RenderCard { title: string; cover: string; postId: number; @@ -162,7 +162,7 @@ declare namespace TGApp.Plugins.Mys.News { * @property {string} colorCss 活动状态按钮背景色 * @returns RenderStatus */ - export interface RenderStatus { + interface RenderStatus { status: string; colorCss: string; } diff --git a/src/plugins/Mys/types/Obc.d.ts b/src/plugins/Mys/types/Obc.d.ts index 7fa35e9f..72a45005 100644 --- a/src/plugins/Mys/types/Obc.d.ts +++ b/src/plugins/Mys/types/Obc.d.ts @@ -1,26 +1,26 @@ /** - * @file plugins Mys types Obc.d.ts + * @file plugins/Mys/types/Obc.d.ts * @description Mys obc 类型定义文件 - * @author BTMuli * @since Alpha v0.2.1 */ /** * @description Mys obc 类型 * @since Alpha v0.2.1 - * @namespace Obc - * @return Obc + * @namespace TGApp.Plugins.Mys.Obc + * @memberof TGApp.Plugins.Mys */ declare namespace TGApp.Plugins.Mys.Obc { /** * @description Mys obc 返回数据 * @since Alpha v0.2.1 * @interface Response - * @extends TGApp.Plugins.Mys.Base.Response + * @extends TGApp.BBS.Response.Base * @property {Obc[]} data.list obc 列表 * @return Response */ - export interface Response extends TGApp.Plugins.Mys.Base.Response { + interface Response extends TGApp.BBS.Response.Base { + retcode: 0; data: { list: Obc[]; }; @@ -39,7 +39,7 @@ declare namespace TGApp.Plugins.Mys.Obc { * @property {unknown[]} list 列表 * @return Data */ - export interface Data { + interface Data { id: number; name: string; parent_id: number; diff --git a/src/plugins/Mys/types/Position.d.ts b/src/plugins/Mys/types/Position.d.ts index cb1ebcda..e3b91686 100644 --- a/src/plugins/Mys/types/Position.d.ts +++ b/src/plugins/Mys/types/Position.d.ts @@ -1,26 +1,26 @@ /** - * @file plugins Mys types Position.d.ts + * @file plugins/Mys/types/Position.d.ts * @description Mys 插件热点追踪接口 - * @author BTMuli * @since Alpha v0.2.1 */ /** * @description Mys 插件热点追踪类型 * @since Alpha v0.2.1 - * @namespace Position - * @return Position + * @namespace TGApp.Plugins.Mys.Position + * @memberof TGApp.Plugins.Mys */ declare namespace TGApp.Plugins.Mys.Position { /** * @description 热点追踪信息的返回类型 * @since Alpha v0.2.1 * @interface Response - * @extends TGApp.Plugins.Mys.Base.Response + * @extends TGApp.BBS.Response.Base * @property {ObcItem[]} data.list obc 列表 * @return Response */ - export interface Response extends TGApp.Plugins.Mys.Obc.Response { + interface Response extends TGApp.BBS.Response.Base { + retcode: 0; data: { list: ObcItem[]; }; @@ -34,7 +34,7 @@ declare namespace TGApp.Plugins.Mys.Position { * @property {Data[]} list 列表 * @return ObcItem */ - export interface ObcItem extends TGApp.Plugins.Mys.Obc.Data { + interface ObcItem extends TGApp.Plugins.Mys.Obc.Data { list: Data[]; } @@ -57,7 +57,7 @@ declare namespace TGApp.Plugins.Mys.Position { * @property {string} end_time 结束时间 // 1680465599000 * @return Data */ - export interface Data { + interface Data { recommend_id: number; content_id: number; title: string; @@ -88,7 +88,7 @@ declare namespace TGApp.Plugins.Mys.Position { * @property {number} time.endStamp 结束时间戳 * @return RenderCard */ - export interface RenderCard { + interface RenderCard { title: string; postId: number; icon: string; diff --git a/src/plugins/Mys/types/Post.d.ts b/src/plugins/Mys/types/Post.d.ts index 28568529..7c9fa200 100644 --- a/src/plugins/Mys/types/Post.d.ts +++ b/src/plugins/Mys/types/Post.d.ts @@ -1,5 +1,5 @@ /** - * @file plugins Mys types post.d.ts + * @file plugins/Mys/types/post.d.ts * @description Mys 插件帖子类型定义文件 * @since Beta v0.3.3 */ @@ -7,19 +7,20 @@ /** * @description Mys 插件帖子类型 * @since Alpha v0.2.1 - * @namespace Post - * @return Post + * @namespace TGApp.Plugins.Mys.Post + * @memberof TGApp.Plugins.Mys */ declare namespace TGApp.Plugins.Mys.Post { /** * @description 帖子返回数据 * @since Alpha v0.2.1 * @interface Response - * @extends TGApp.Plugins.Mys.Base.Response + * @extends TGApp.BBS.Response.Base * @property {FullData} data.post 帖子数据 * @return Response */ - export interface Response extends TGApp.Plugins.Mys.Base.Response { + interface Response extends TGApp.BBS.Response.Base { + retcode: 0; data: { post: FullData; }; @@ -52,7 +53,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {TGApp.Plugins.Mys.News.Meta} news_meta 咨讯元数据,可能为 null * @return FullData */ - export interface FullData { + interface FullData { post: Post; forum: Forum; topics: Topic[]; @@ -121,7 +122,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {number} selected_comment 是否选择评论 * @return Post */ - export interface Post { + interface Post { game_id: number; post_id: string; f_forum_id: number; @@ -175,7 +176,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {unknown} forum_cate 版块分类,可能为 null * @return Forum */ - export interface Forum { + interface Forum { id: number; name: string; icon: string; @@ -197,7 +198,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {number} content_type 内容类型 * @return Topic */ - export interface Topic { + interface Topic { id: number; name: string; cover: string; @@ -219,7 +220,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {number} forward_num 转发数 * @return Stat */ - export interface Stat { + interface Stat { view_num: number; reply_num: number; like_num: number; @@ -249,7 +250,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {boolean} is_deleted 是否已删除 * @return Image */ - export interface Image { + interface Image { url: string; height: number; width: number; @@ -278,7 +279,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {number} answer_num 回答数 * @return HelpSys */ - export interface HelpSys { + interface HelpSys { top_up: unknown | null; top_n: unknown[]; answer_num: number; @@ -293,7 +294,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {string[]} images 图片 URL * @return Content */ - export interface PostContent { + interface PostContent { describe: string; images?: string[]; } @@ -330,7 +331,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {string} attributes.link 链接 * @return StructuredContent */ - export interface StructuredContent { + interface StructuredContent { insert: | { image?: string; @@ -386,7 +387,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {number} review_status 审核状态 * @return StructuredVod */ - export interface StructuredVod { + interface StructuredVod { id: number; duration: number; cover: string; @@ -422,7 +423,7 @@ declare namespace TGApp.Plugins.Mys.Post { * @property {number} landing_url_type 落地链接类型 * @return StructuredLinkCard */ - export interface StructuredLinkCard { + interface StructuredLinkCard { link_type: number; origin_url: string; landing_url: string; diff --git a/src/plugins/Mys/types/User.d.ts b/src/plugins/Mys/types/User.d.ts index a1325925..a9d9b737 100644 --- a/src/plugins/Mys/types/User.d.ts +++ b/src/plugins/Mys/types/User.d.ts @@ -1,26 +1,26 @@ /** - * @file plugins Mys types user.ts + * @file plugins/Mys/types/user.ts * @description Mys 插件用户类型定义文件 - * @author BTMuli * @since Alpha v0.2.2 */ /** * @description Mys 插件用户类型 * @since Alpha v0.2.2 - * @namespace User - * @return User + * @namespace TGApp.Plugins.Mys.User + * @memberof TGApp.Plugins.Mys */ declare namespace TGApp.Plugins.Mys.User { /** * @description 主页用户信息返回 * @since Alpha v0.2.1 * @interface HomeResponse - * @extends TGApp.Plugins.Mys.Base.Response + * @extends TGApp.BBS.Response.Base * @property {Home} data 用户信息 * @return HomeResponse */ - export interface HomeResponse extends TGApp.Plugins.Mys.Base.Response { + interface HomeResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: Home; } @@ -45,7 +45,7 @@ declare namespace TGApp.Plugins.Mys.User { * @property {number} audit_info.nickname_status 昵称审核状态 * @return Home */ - export interface Home { + interface Home { user_info: Info; follow_relation: unknown; auth_relations: unknown[]; @@ -86,7 +86,7 @@ declare namespace TGApp.Plugins.Mys.User { * @property {string} ip_region 用户 IP 地区 * @return Info */ - export interface Info { + interface Info { uid: string; nickname: string; introduce: string; @@ -112,7 +112,7 @@ declare namespace TGApp.Plugins.Mys.User { * @property {string} label 认证标签 * @return Certification */ - export interface Certification { + interface Certification { type: number; label: string; } @@ -126,7 +126,7 @@ declare namespace TGApp.Plugins.Mys.User { * @property {number} game_id 游戏 ID * @return LevelExp */ - export interface LevelExp { + interface LevelExp { level: number; exp: number; game_id: number; @@ -147,7 +147,7 @@ declare namespace TGApp.Plugins.Mys.User { * @property {string} follow_collection_cnt 收藏数 * @return Archive */ - export interface Archive { + interface Archive { like_num: string; post_num: string; replypost_num: string; @@ -192,7 +192,7 @@ declare namespace TGApp.Plugins.Mys.User { * @property {number} created_at 创建时间 * @return Community */ - export interface Community { + interface Community { is_realname: boolean; agree_status: boolean; silent_end_time: number; @@ -244,7 +244,7 @@ declare namespace TGApp.Plugins.Mys.User { * @property {string} pendant 用户挂件 URL,可能为 "" * @return Post */ - export interface Post { + interface Post { uid: string; nickname: string; introduce: string; @@ -269,7 +269,7 @@ declare namespace TGApp.Plugins.Mys.User { * @property {boolean} is_collected 是否收藏 * @returns {SelfOperation} */ - export interface SelfOperation { + interface SelfOperation { attitude: number; is_collected: boolean; } diff --git a/src/types/BBS/Announcement.d.ts b/src/types/BBS/Announcement.d.ts index c23a46d4..a37fd298 100644 --- a/src/types/BBS/Announcement.d.ts +++ b/src/types/BBS/Announcement.d.ts @@ -1,10 +1,15 @@ /** - * @file types BBS Announcement.d.ts + * @file types/BBS/Announcement.d.ts * @description 从 BBS 获取到的游戏内公告类型定义文件 - * @author BTMuli * @since Alpha v0.1.5 */ +/** + * @description 游戏内公告类型定义 + * @since Alpha v0.1.5 + * @namespace TGApp.BBS.Announcement + * @memberof TGApp.BBS + */ declare namespace TGApp.BBS.Announcement { /** * @description 公告列表返回响应类型 @@ -14,7 +19,8 @@ declare namespace TGApp.BBS.Announcement { * @property {ListData} data - 公告列表数据 * @return ListResponse */ - export interface ListResponse extends TGApp.BBS.Response.Base { + interface ListResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: ListData; } @@ -26,7 +32,8 @@ declare namespace TGApp.BBS.Announcement { * @property {ContentData} data - 公告内容数据 * @return ContentResponse */ - export interface ContentResponse extends TGApp.BBS.Response.Base { + interface ContentResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: ContentData; } @@ -48,7 +55,7 @@ declare namespace TGApp.BBS.Announcement { * @property {unknown} static_sign - 静态签名 * @return ListData */ - export interface ListData { + interface ListData { list: ListItem[]; total: number; type_list: ListType[]; @@ -73,7 +80,7 @@ declare namespace TGApp.BBS.Announcement { * @property {number} pic_total - 图片总数 * @return ContentData */ - export interface ContentData { + interface ContentData { list: ContentItem[]; total: number; pic_list: unknown[]; @@ -89,7 +96,7 @@ declare namespace TGApp.BBS.Announcement { * @property {string} type_label - 公告类型标签 * @return ListItem */ - export interface ListItem { + interface ListItem { list: AnnoSingle[]; type_id: number; type_label: string; @@ -121,7 +128,7 @@ declare namespace TGApp.BBS.Announcement { * @property {boolean} extra_remind 是否有额外提醒 * @return AnnoSingle */ - export interface AnnoSingle { + interface AnnoSingle { ann_id: number; title: string; subtitle: string; @@ -153,7 +160,7 @@ declare namespace TGApp.BBS.Announcement { * @property {string} mi18n_name 公告类型国际化名称 * @return ListType */ - export interface ListType { + interface ListType { id: number; name: string; mi18n_name: string; @@ -171,7 +178,7 @@ declare namespace TGApp.BBS.Announcement { * @property {string} lang 公告语言 * @return ContentItem */ - export interface ContentItem { + interface ContentItem { ann_id: number; title: string; subtitle: string; diff --git a/src/types/BBS/Response.d.ts b/src/types/BBS/Response.d.ts index 854bc15a..4e4652c9 100644 --- a/src/types/BBS/Response.d.ts +++ b/src/types/BBS/Response.d.ts @@ -21,9 +21,9 @@ declare namespace TGApp.BBS.Response { * @return Base */ interface Base { - retcode: number; + retcode: Pick; message: string; - data: any; + data: never; } /** @@ -48,6 +48,7 @@ declare namespace TGApp.BBS.Response { * @return getTokens */ interface getTokens extends Base { + retcode: 0; data: { list: getTokensRes[]; }; @@ -62,6 +63,7 @@ declare namespace TGApp.BBS.Response { * @return getLTokenBySToken */ interface getLTokenBySToken extends Base { + retcode: 0; data: { ltoken: string; }; @@ -77,6 +79,7 @@ declare namespace TGApp.BBS.Response { * @return getCookieTokenBySToken */ interface getCookieTokenBySToken extends Base { + retcode: 0; data: { uid: string; cookie_token: string; @@ -94,6 +97,7 @@ declare namespace TGApp.BBS.Response { * @return verifyUserInfoBySToken */ interface verifyUserInfoBySToken extends Base { + retcode: 0; data: { user_info: TGApp.BBS.Account.VerifySTokenInfo; realname_info: unknown; @@ -110,6 +114,7 @@ declare namespace TGApp.BBS.Response { * @return getStokenByGameToken */ interface getStokenByGameToken extends Base { + retcode: 0; data: getStokenByGameTokenData; } @@ -144,6 +149,7 @@ declare namespace TGApp.BBS.Response { * @return getCookieTokenByGameToken */ interface getCookieTokenByGameToken extends Base { + retcode: 0; data: { uid: string; cookie_token: string; @@ -161,6 +167,7 @@ declare namespace TGApp.BBS.Response { * @return getActionTicketBySToken */ interface getActionTicketBySToken extends Base { + retcode: 0; data: { ticket: string; is_verified: boolean; diff --git a/src/types/Game/Abyss.d.ts b/src/types/Game/Abyss.d.ts index e7090d7d..a1013055 100644 --- a/src/types/Game/Abyss.d.ts +++ b/src/types/Game/Abyss.d.ts @@ -1,10 +1,15 @@ /** - * @file types Game Abyss.d.ts + * @file types/Game/Abyss.d.ts * @description 游戏深渊相关类型定义文件 - * @author BTMuli * @since Alpha v0.2.0 */ +/** + * @description 深渊数据相关类型 + * @since Alpha v0.2.0 + * @namespace TGApp.Game.Abyss + * @memberof TGApp.Game + */ declare namespace TGApp.Game.Abyss { /** * @description 深渊数据返回类型 @@ -14,7 +19,8 @@ declare namespace TGApp.Game.Abyss { * @property {FullData} data - 深渊数据 * @return Response */ - export interface Response extends TGApp.BBS.Response.Base { + interface Response extends TGApp.BBS.Response.Base { + retcode: 0; data: FullData; } @@ -39,7 +45,7 @@ declare namespace TGApp.Game.Abyss { * @property {boolean} is_unlock - 是否解锁 * @return FullData */ - export interface FullData { + interface FullData { schedule_id: number; start_time: string; end_time: string; @@ -67,7 +73,7 @@ declare namespace TGApp.Game.Abyss { * @property {number} rarity - 角色星级 * @return CharacterData */ - export interface CharacterData { + interface CharacterData { avatar_id: number; avatar_icon: string; value: number; @@ -87,7 +93,7 @@ declare namespace TGApp.Game.Abyss { * @property {Level[]} levels - 层内关卡数据 * @return Floor */ - export interface Floor { + interface Floor { index: number; icon: string; is_unlock: boolean; @@ -107,7 +113,7 @@ declare namespace TGApp.Game.Abyss { * @property {Battle[]} battles - 关卡内战斗数据 * @return Level */ - export interface Level { + interface Level { index: number; star: number; max_star: number; @@ -123,7 +129,7 @@ declare namespace TGApp.Game.Abyss { * @property {CharacterInfo[]} avatars - 角色信息 * @return Battle */ - export interface Battle { + interface Battle { index: number; timestamp: string; avatars: CharacterInfo[]; @@ -139,7 +145,7 @@ declare namespace TGApp.Game.Abyss { * @property {number} rarity - 角色星级 * @return CharacterInfo */ - export interface CharacterInfo { + interface CharacterInfo { id: number; icon: string; level: number; diff --git a/src/types/Game/Calculate.d.ts b/src/types/Game/Calculate.d.ts index 4f998afd..f05c5a08 100644 --- a/src/types/Game/Calculate.d.ts +++ b/src/types/Game/Calculate.d.ts @@ -1,10 +1,15 @@ /** - * @file types Game Calculate.d.ts + * @file types/Game/Calculate.d.ts * @description 养成计算器相关类型定义文件 - * @author BTMuli * @since Alpha v0.2.1 */ +/** + * @description 养成计算器相关类型定义命名空间 + * @since Alpha v0.2.1 + * @namespace TGApp.Game.Calculate + * @memberof TGApp.Game + */ declare namespace TGApp.Game.Calculate { /** * @description 获取同步角色列表返回 @@ -15,7 +20,8 @@ declare namespace TGApp.Game.Calculate { * @property {Array} data.list - 角色列表 * @return SyncAvatarListResponse */ - export interface SyncAvatarListResponse extends TGApp.BBS.Response.Base { + interface SyncAvatarListResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: { list: AvatarListItem[]; }; @@ -35,7 +41,7 @@ declare namespace TGApp.Game.Calculate { * @property {number} level_current - 角色当前等级 * @return AvatarListItem */ - export interface AvatarListItem { + interface AvatarListItem { id: number; name: string; icon: string; @@ -55,7 +61,8 @@ declare namespace TGApp.Game.Calculate { * @property {AvatarDetail} data - 角色详情 * @return SyncAvatarDetailResponse */ - export interface SyncAvatarDetailResponse extends TGApp.BBS.Response.Base { + interface SyncAvatarDetailResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: TGApp.Game.Calculate.AvatarDetail; } @@ -68,7 +75,7 @@ declare namespace TGApp.Game.Calculate { * @property {AvatarDetailRelic[]} reliquary_list - 角色圣遗物列表 * @return AvatarDetail */ - export interface AvatarDetail { + interface AvatarDetail { skill_list: AvatarDetailSkill[]; weapon: AvatarDetailWeapon; reliquary_list: AvatarDetailRelic[]; @@ -86,7 +93,7 @@ declare namespace TGApp.Game.Calculate { * @property {number} level_current - 技能当前等级 * @return AvatarDetailSkill */ - export interface AvatarDetailSkill { + interface AvatarDetailSkill { id: number; group_id: number; name: string; @@ -108,7 +115,7 @@ declare namespace TGApp.Game.Calculate { * @property {number} level_current - 武器当前等级 * @return AvatarDetailWeapon */ - export interface AvatarDetailWeapon { + interface AvatarDetailWeapon { id: number; name: string; icon: string; @@ -131,7 +138,7 @@ declare namespace TGApp.Game.Calculate { * @property {number} max_level - 圣遗物最大等级 * @return AvatarDetailRelic */ - export interface AvatarDetailRelic { + interface AvatarDetailRelic { id: number; name: string; icon: string; diff --git a/src/types/Game/Character.d.ts b/src/types/Game/Character.d.ts index 601ad77f..0cdf3765 100644 --- a/src/types/Game/Character.d.ts +++ b/src/types/Game/Character.d.ts @@ -1,10 +1,15 @@ /** - * @file types Game Character.d.ts + * @file types/Game/Character.d.ts * @description 游戏角色相关类型定义文件 - * @author BTMuli * @since Alpha v0.2.0 */ +/** + * @description 游戏角色相关类型定义命名空间 + * @since Alpha v0.2.0 + * @namespace TGApp.Game.Character + * @memberof TGApp.Game + */ declare namespace TGApp.Game.Character { /** * @description 角色列表数据返回类型 @@ -15,7 +20,8 @@ declare namespace TGApp.Game.Character { * @property {ListRole} data.role - 角色信息 * @return ListResponse */ - export interface ListResponse extends TGApp.BBS.Response.Base { + interface ListResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: { avatars: ListItem[]; role: ListRole; @@ -43,7 +49,7 @@ declare namespace TGApp.Game.Character { * @property {unknown} external * @return ListItem */ - export interface ListItem { + interface ListItem { id: number; image: string; icon: string; @@ -71,7 +77,7 @@ declare namespace TGApp.Game.Character { * @property {number} level - 角色等级 * @return ListRole */ - export interface ListRole { + interface ListRole { AvatarUrl: string; nickname: string; region: string; @@ -94,7 +100,7 @@ declare namespace TGApp.Game.Character { * @property {number} affix_level - 武器精炼等级 * @return LIWeapon */ - export interface LIWeapon { + interface LIWeapon { id: number; name: string; icon: string; @@ -121,7 +127,7 @@ declare namespace TGApp.Game.Character { * @property {TGApp.Game.Constant.EnumRelic} pos_name - 圣遗物位置名称 * @return LIRelic */ - export interface LIRelic { + interface LIRelic { id: number; name: string; icon: string; @@ -142,7 +148,7 @@ declare namespace TGApp.Game.Character { * @property {string} affixes[].effect - 圣遗物套装效果 * @return RelicSet */ - export interface RelicSet { + interface RelicSet { id: number; name: string; affixes: Array<{ @@ -163,7 +169,7 @@ declare namespace TGApp.Game.Character { * @property {number} pos - 命座位置 * @return LIConstellation */ - export interface LIConstellation { + interface LIConstellation { id: number; name: string; icon: string; @@ -181,7 +187,7 @@ declare namespace TGApp.Game.Character { * @property {string} icon - 时装图标 * @return LICostume */ - export interface LICostume { + interface LICostume { id: number; name: string; icon: string; diff --git a/src/types/Game/DailyNotes.d.ts b/src/types/Game/DailyNotes.d.ts index 6e277c78..11ef1f25 100644 --- a/src/types/Game/DailyNotes.d.ts +++ b/src/types/Game/DailyNotes.d.ts @@ -1,10 +1,15 @@ /** - * @file types Game DailyNotes.d.ts + * @file types/Game/DailyNotes.d.ts * @description 获取实时便笺数据类型定义文件 - * @author BTMuli * @since Alpha v0.2.2 */ +/** + * @description 获取实时便笺数据 + * @since Alpha v0.2.2 + * @namespace TGApp.Game.DailyNotes + * @memberof TGApp.Game + */ declare namespace TGApp.Game.DailyNotes { /** * @description 便笺数据返回 @@ -14,7 +19,8 @@ declare namespace TGApp.Game.DailyNotes { * @property {FullInfo} data - 便笺数据 * @return Response */ - export interface Response extends TGApp.BBS.Response.Base { + interface Response extends TGApp.BBS.Response.Base { + retcode: 0; data: FullInfo; } @@ -40,7 +46,7 @@ declare namespace TGApp.Game.DailyNotes { * @property {Transform} transformer - 便笺数据转换器 * @return FullInfo */ - export interface FullInfo { + interface FullInfo { current_resin: number; max_resin: number; resin_recovery_time: string; @@ -68,7 +74,7 @@ declare namespace TGApp.Game.DailyNotes { * @property {string} remained_time - 剩余时间(秒) * @return Expedition */ - export interface Expedition { + interface Expedition { avatar_side_icon: string; status: string; remained_time: string; @@ -85,7 +91,7 @@ declare namespace TGApp.Game.DailyNotes { * @property {string} last_job_id - 上次任务 ID * @return Transform */ - export interface Transform { + interface Transform { obtained: boolean; recovery_time: TransformTime; wiki: string; @@ -104,7 +110,7 @@ declare namespace TGApp.Game.DailyNotes { * @property {boolean} reached - 是否已达到恢复时间 * @return TransformTime */ - export interface TransformTime { + interface TransformTime { Day: number; Hour: number; Minute: number; diff --git a/src/types/Game/Gacha.d.ts b/src/types/Game/Gacha.d.ts index 6b718a94..40dfdbd4 100644 --- a/src/types/Game/Gacha.d.ts +++ b/src/types/Game/Gacha.d.ts @@ -1,10 +1,15 @@ /** - * @file types Game Gacha.d.ts + * @file types/Game/Gacha.d.ts * @description 游戏抽卡相关类型定义文件 - * @author BTMuli * @since Beta v0.3.0 */ +/** + * @description 游戏抽卡相关类型定义命名空间 + * @since Beta v0.3.0 + * @namespace TGApp.Game.Gacha + * @memberof TGApp.Game + */ declare namespace TGApp.Game.Gacha { /** * @description 获取 authkey 返回类型 @@ -16,7 +21,8 @@ declare namespace TGApp.Game.Gacha { * @property {string} data.authkey - authkey * @return AuthkeyResponse */ - export interface AuthkeyResponse extends TGApp.BBS.Response.Base { + interface AuthkeyResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: { sign_type: number; authkey_ver: number; @@ -35,7 +41,8 @@ declare namespace TGApp.Game.Gacha { * @property {GachaItem[]} data.list - 抽卡记录列表 * @return GachaLogResponse */ - export interface GachaLogResponse extends TGApp.BBS.Response.Base { + interface GachaLogResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: { page: number; size: number; @@ -60,7 +67,7 @@ declare namespace TGApp.Game.Gacha { * @property {string} id - 抽卡记录 id * @return GachaItem */ - export interface GachaItem { + interface GachaItem { uid: string; gacha_type: string; item_id: string; diff --git a/src/types/Game/Record.d.ts b/src/types/Game/Record.d.ts index 4f597512..62aaf652 100644 --- a/src/types/Game/Record.d.ts +++ b/src/types/Game/Record.d.ts @@ -1,10 +1,15 @@ /** - * @file types Game Record.d.ts + * @file types/Game/Record.d.ts * @description 原神战绩相关类型定义文件 - * @author BTMuli * @since Alpha v0.2.2 */ +/** + * @description 原神战绩相关类型定义命名空间 + * @since Alpha v0.2.2 + * @namespace TGApp.Game.Record + * @memberof TGApp.Game + */ declare namespace TGApp.Game.Record { /** * @description 原神战绩数据返回类型 @@ -14,7 +19,8 @@ declare namespace TGApp.Game.Record { * @property {FullData} data - 原神战绩数据 * @return Response */ - export interface Response extends TGApp.BBS.Response.Base { + interface Response extends TGApp.BBS.Response.Base { + retcode: 0; data: FullData; } @@ -30,7 +36,7 @@ declare namespace TGApp.Game.Record { * @property {Home[]} homes - 尘歌壶信息 * @return FullData */ - export interface FullData { + interface FullData { role: Role; avatars: Avatar[]; stats: Stats; @@ -49,7 +55,7 @@ declare namespace TGApp.Game.Record { * @property {number} level - 等级 * @return Role */ - export interface Role { + interface Role { AvatarUrl: string; nickname: string; region: string; @@ -72,7 +78,7 @@ declare namespace TGApp.Game.Record { * @property {boolean} is_chosen - 角色是否展示 * @return Avatar */ - export interface Avatar { + interface Avatar { id: number; image: string; name: string; @@ -107,7 +113,7 @@ declare namespace TGApp.Game.Record { * @property {number} hydroculus_number - 水神瞳数量 * @return Stats */ - export interface Stats { + interface Stats { active_day_number: number; achievement_number: number; anemoculus_number: number; @@ -145,7 +151,7 @@ declare namespace TGApp.Game.Record { * @property {string} cover - 封面 URL * @return WorldExplore */ - export interface WorldExplore { + interface WorldExplore { level: number; exploration_percentage: number; icon: string; @@ -170,7 +176,7 @@ declare namespace TGApp.Game.Record { * @property {string} icon - 图标 * @return WorldOffering */ - export interface WorldOffering { + interface WorldOffering { name: string; level: number; icon: string; @@ -190,7 +196,7 @@ declare namespace TGApp.Game.Record { * @property {string} comfort_level_icon - 洞天仙力等级图标 * @return Home */ - export interface Home { + interface Home { level: number; visit_num: number; comfort_num: number; diff --git a/src/types/User/Account.d.ts b/src/types/User/Account.d.ts index 5af70e5d..743d6916 100644 --- a/src/types/User/Account.d.ts +++ b/src/types/User/Account.d.ts @@ -1,10 +1,15 @@ /** - * @file types User Account.d.ts + * @file types/User/Account.d.ts * @description 用户账号相关类型定义文件 - * @author BTMuli * @since Alpha v0.1.5 */ +/** + * @description 用户账号相关类型定义命名空间 + * @since Alpha v0.1.5 + * @namespace TGApp.User.Account + * @memberof TGApp.User + */ declare namespace TGApp.User.Account { /** * @description 游戏账号返回类型 @@ -14,7 +19,8 @@ declare namespace TGApp.User.Account { * @property {Game[]} data.list 游戏账号列表 * @return GameResponse */ - export interface GameResponse extends TGApp.BBS.Response.Base { + interface GameResponse extends TGApp.BBS.Response.Base { + retcode: 0; data: { list: Game[]; }; @@ -34,7 +40,7 @@ declare namespace TGApp.User.Account { * @property {string} region_name 游戏区域名称 * @return Game */ - export interface Game { + interface Game { game_biz: string; game_uid: string; is_chosen: boolean; diff --git a/src/web/request/genAuthkey.ts b/src/web/request/genAuthkey.ts index 2b5627f6..94b48b51 100644 --- a/src/web/request/genAuthkey.ts +++ b/src/web/request/genAuthkey.ts @@ -1,5 +1,5 @@ /** - * @file web request genAuthkey.ts + * @file web/request/genAuthkey.ts * @description 生成 authkey * @since Beta v0.3.0 */ @@ -29,7 +29,7 @@ export async function genAuthkey( }; const header = TGUtils.User.getHeader(cookie, "POST", JSON.stringify(data), "lk2", true); return await http - .fetch(url, { + .fetch(url, { method: "POST", headers: header, body: http.Body.json(data), diff --git a/src/web/request/getAbyss.ts b/src/web/request/getAbyss.ts index 86f584f2..c460e68c 100644 --- a/src/web/request/getAbyss.ts +++ b/src/web/request/getAbyss.ts @@ -1,5 +1,5 @@ /** - * @file web request getAbyss.ts + * @file web/request/getAbyss.ts * @description 获取深渊信息 * @since Beta v0.3.0 */ @@ -27,7 +27,7 @@ export async function getAbyss( const params = { role_id, schedule_type, server: account.region }; const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); return await http - .fetch(url, { + .fetch(url, { method: "GET", headers: header, query: params, diff --git a/src/web/request/getCookieToken.ts b/src/web/request/getCookieToken.ts index 7cc7cd4d..adc092a2 100644 --- a/src/web/request/getCookieToken.ts +++ b/src/web/request/getCookieToken.ts @@ -1,5 +1,5 @@ /** - * @file web request getCookieToken.ts + * @file web/request/getCookieToken.ts * @description 获取 Cookie Token 的请求函数 * @since Beta v0.3.0 */ @@ -28,7 +28,7 @@ export async function getCookieTokenBySToken( const params = { stoken: Stoken }; const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); return await http - .fetch(url, { + .fetch(url, { method: "GET", headers: header, query: params, @@ -53,7 +53,7 @@ export async function getCookieTokenByGameToken( const url = "https://api-takumi.mihoyo.com/auth/api/getCookieAccountInfoByGameToken"; const data = { account_id: Number(accountId), game_token: gameToken }; return await http - .fetch(url, { + .fetch(url, { method: "POST", body: http.Body.json(data), }) diff --git a/src/web/request/getGachaLog.ts b/src/web/request/getGachaLog.ts index 981300bd..e2240d2a 100644 --- a/src/web/request/getGachaLog.ts +++ b/src/web/request/getGachaLog.ts @@ -1,11 +1,9 @@ /** - * @file web request getGachaLog.ts + * @file web/request/getGachaLog.ts * @description 获取抽卡记录请求函数 - * @author BTMuli * @since Beta v0.3.0 */ -// tauri import { http } from "@tauri-apps/api"; /** @@ -33,7 +31,7 @@ export async function getGachaLog( end_id: endId, }; return await http - .fetch(url, { + .fetch(url, { method: "GET", query: params, }) diff --git a/src/web/request/getGameAccounts.ts b/src/web/request/getGameAccounts.ts index 3ce81066..71e803bc 100644 --- a/src/web/request/getGameAccounts.ts +++ b/src/web/request/getGameAccounts.ts @@ -1,5 +1,5 @@ /** - * @file web request getGameAccounts.ts + * @file web/request/getGameAccounts.ts * @description 获取游戏账号信息相关请求函数 * @since Alpha v0.1.5 */ @@ -65,7 +65,7 @@ async function getGameAccounts( ): Promise { const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); return await http - .fetch(url, { + .fetch(url, { method: "GET", headers: header, query: params, diff --git a/src/web/request/getGameRecord.ts b/src/web/request/getGameRecord.ts index e6b1fa22..1e24ec8b 100644 --- a/src/web/request/getGameRecord.ts +++ b/src/web/request/getGameRecord.ts @@ -1,5 +1,5 @@ /** - * @file core utils getGameRecord.ts + * @file core/utils/getGameRecord.ts * @description 获取游戏数据的函数 * @since Alpha v0.2.1 */ @@ -30,7 +30,7 @@ export async function getGameRecord( const params = { role_id: user.gameUid, server: user.region }; const header = TGUtils.User.getHeader(ck, "GET", params, "common"); return await http - .fetch(url, { + .fetch(url, { method: "GET", headers: header, query: params, diff --git a/src/web/request/getLToken.ts b/src/web/request/getLToken.ts index ce57f164..72753916 100644 --- a/src/web/request/getLToken.ts +++ b/src/web/request/getLToken.ts @@ -1,7 +1,6 @@ /** - * @file web request getLToken.ts + * @file web/request/getLToken.ts * @description 获取 ltoken 的请求 - * @since Beta v0.3.0 */ @@ -29,7 +28,7 @@ export async function getLTokenBySToken( const params = { stoken: Stoken }; const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); return await http - .fetch(url, { + .fetch(url, { method: "GET", headers: header, query: params, diff --git a/src/web/request/getRoleList.ts b/src/web/request/getRoleList.ts index 90af6e86..78873b5e 100644 --- a/src/web/request/getRoleList.ts +++ b/src/web/request/getRoleList.ts @@ -1,5 +1,5 @@ /** - * @file web request getRoleList.ts + * @file web/request/getRoleList.ts * @description 获取游戏角色列表的请求方法 * @since Alpha v0.2.0 */ @@ -33,7 +33,7 @@ export async function getGameRoleListByLToken( }; const header = TGUtils.User.getHeader(ck, "POST", JSON.stringify(data), "common"); return await http - .fetch(url, { + .fetch(url, { method: "POST", headers: header, body: http.Body.json(data), diff --git a/src/web/request/getStoken.ts b/src/web/request/getStoken.ts index 64046f27..32359cbc 100644 --- a/src/web/request/getStoken.ts +++ b/src/web/request/getStoken.ts @@ -1,5 +1,5 @@ /** - * @file web request getStoken.ts + * @file web/request/getStoken.ts * @description 获取 stoken * @since Beta v0.3.0 */ @@ -25,7 +25,7 @@ export async function getStokenByGameToken( "x-rpc-app_id": TGConstant.BBS.APP_ID, }; return await http - .fetch(url, { + .fetch(url, { method: "POST", headers: header, body: http.Body.json(data), diff --git a/src/web/request/getTokens.ts b/src/web/request/getTokens.ts index 986d81c3..2a284b09 100644 --- a/src/web/request/getTokens.ts +++ b/src/web/request/getTokens.ts @@ -1,5 +1,5 @@ /** - * @file web request getTokens.ts + * @file web/request/getTokens.ts * @description 获取游戏 Token * @since Alpha v0.1.5 */ @@ -29,7 +29,7 @@ export async function getTokensByLoginTicket( const params = { login_ticket: ticket, token_types: 3, uid }; const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); return await http - .fetch(url, { + .fetch(url, { method: "GET", headers: header, query: params, diff --git a/src/web/request/getUserInfo.ts b/src/web/request/getUserInfo.ts index bb39bb6e..98c6e905 100644 --- a/src/web/request/getUserInfo.ts +++ b/src/web/request/getUserInfo.ts @@ -1,5 +1,5 @@ /** - * @file web request getUserInfo.ts + * @file web/request/getUserInfo.ts * @description 获取用户信息请求 * @since Beta v0.3.4 */ @@ -28,7 +28,7 @@ export async function getUserInfoByCookie( const params = { gids: "2" }; const header = TGUtils.User.getHeader(cookie, "GET", params, "common", true); return await http - .fetch(url, { + .fetch(url, { method: "GET", headers: header, query: params, diff --git a/src/web/request/verifyLToken.ts b/src/web/request/verifyLToken.ts index 00d8de05..e0680b3d 100644 --- a/src/web/request/verifyLToken.ts +++ b/src/web/request/verifyLToken.ts @@ -1,5 +1,5 @@ /** - * @file web request verifyLToken.ts + * @file web/request/verifyLToken.ts * @description 验证 stoken 的请求函数 * @since Alpha v0.1.5 */ @@ -28,7 +28,7 @@ export async function verifyLToken( const data = { ltoken }; const header = TGUtils.User.getHeader(cookie, "POST", data, "common"); return await http - .fetch(url, { + .fetch(url, { method: "POST", headers: header, body: http.Body.json(data),