diff --git a/src/types/BBS/Response.d.ts b/src/types/BBS/Response.d.ts index f5db03a4..aeb67b6f 100644 --- a/src/types/BBS/Response.d.ts +++ b/src/types/BBS/Response.d.ts @@ -1,7 +1,7 @@ /** * @file types/BBS/Response.d.ts * @description BBS 返回数据类型定义文件 - * @since Beta v0.3.6 + * @since Beta v0.3.9 */ /** @@ -14,14 +14,14 @@ declare namespace TGApp.BBS.Response { /** * @description 基础返回类型,设计米游社接口请求都是这个类型 * @interface Base - * @since Beta v0.3.5 + * @since Beta v0.3.9 * @property {never} retcode - 响应代码 * @property {string} message - 响应消息 * @property {never} data - 响应数据 * @return Base */ interface Base { - retcode: never; + retcode: number; message: string; data: never; } diff --git a/src/types/Plugins/JSBridge.d.ts b/src/types/Plugins/JSBridge.d.ts index a8780e29..caeb0558 100644 --- a/src/types/Plugins/JSBridge.d.ts +++ b/src/types/Plugins/JSBridge.d.ts @@ -35,14 +35,6 @@ declare namespace TGApp.Plugins.JSBridge { */ type NullArg = Arg; - /** - * @description 通用 arg 参数-未知参数 - * @since Beta v0.3.9 - * @interface UnknownArg - * @return UnknownArg - */ - type UnknownArg = Arg; - /** * @description configShare 方法参数 * @since Beta v0.3.9 diff --git a/src/utils/TGClient.ts b/src/utils/TGClient.ts index 8c12741b..6908b69d 100644 --- a/src/utils/TGClient.ts +++ b/src/utils/TGClient.ts @@ -173,7 +173,7 @@ class TGClient { * @returns {Promise} - 返回值 */ async handleCallback(arg: Event): Promise { - const argParse: TGApp.Plugins.JSBridge.UnknownArg = JSON.parse(arg.payload); + const argParse: TGApp.Plugins.JSBridge.Arg = JSON.parse(arg.payload); if (argParse.method.startsWith("teyvat")) { await this.handleCustomCallback(argParse); return; @@ -271,16 +271,16 @@ class TGClient { * @func handleCustomCallback * @since Beta v0.3.9 * @desc 处理自定义的 callback - * @param {TGApp.Plugins.JSBridge.UnknownArg} arg - 事件参数 + * @param {TGApp.Plugins.JSBridge.Arg} arg - 事件参数 * @returns {Promise} - 返回值 */ - async handleCustomCallback(arg: TGApp.Plugins.JSBridge.UnknownArg): Promise { + async handleCustomCallback(arg: TGApp.Plugins.JSBridge.Arg): Promise { switch (arg.method) { case "teyvat_open": createPost(arg.payload); break; default: - console.warn(`[customCallback] ${arg.payload}`); + console.warn(`[customCallback] ${arg.method}`); } }