From 98c911469afbe705e162ec6bd176ac39709a4a01 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Thu, 20 Nov 2025 18:18:48 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E9=80=82=E9=85=8D=E5=BC=82=E5=B8=B8"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 999ddc708c25dfd0f8f0a233bafabfa03000a1a0. --- src/types/BBS/Geetest.d.ts | 70 ++++++++++++++++++++++---------------- src/utils/TGWindow.ts | 11 +++--- 2 files changed, 46 insertions(+), 35 deletions(-) diff --git a/src/types/BBS/Geetest.d.ts b/src/types/BBS/Geetest.d.ts index 9cda013b..9bf5d001 100644 --- a/src/types/BBS/Geetest.d.ts +++ b/src/types/BBS/Geetest.d.ts @@ -5,8 +5,11 @@ declare namespace TGApp.BBS.Geetest { /** - * 创建验证的响应 + * @description 创建验证的响应 * @since Beta v0.7.1 + * @interface CreateResp + * @extends TGApp.BBS.Response.BaseWithData + * @property {CreateRes} data - 极验验证数据 */ type CreateResp = TGApp.BBS.Response.BaseWithData; @@ -51,45 +54,45 @@ declare namespace TGApp.BBS.Geetest { }; /** - * 验证极验验证的响应 + * @description 验证极验验证的响应 * @since Beta v0.7.1 + * @interface VerifyResp + * @extends TGApp.BBS.Response.Base + * @property {VerifyRes} data - 极验验证数据 */ type VerifyResp = TGApp.BBS.Response.BaseWithData; /** - * 极验验证的请求数据 + * @description 极验验证的请求数据 * @since Beta v0.7.1 + * @interface VerifyRes + * @property {string} challenge - 极验验证 challenge + * @property {string} validate - 极验验证 validate */ - type VerifyRes = { - /* 极验验证 challenge */ - challenge: string; - }; + type VerifyRes = { challenge: string }; /** - * 极验验证的请求方法-请求参数 + * @description 极验验证的请求方法-请求参数 * @since Beta v0.7.1 + * @interface InitGeetestParams + * @property {string} gt - 极验验证 gt + * @property {string} challenge - 极验验证 challenge + * @property {boolean} offline - 极验验证 offline + * @property {boolean} new_captcha - 极验验证 new_captcha + * @property {string} product - 极验验证 product + * @property {string} width - 极验验证 width + * @property {string} area - 极验验证 area */ type InitGeetestParams = { - /* gt */ gt: string; - /* challenge */ challenge: string; - /* 是否离线 */ offline: boolean; - /* 是否是新验证码 */ new_captcha: boolean; - /* 验证形式 */ product: string; - /* 宽度 */ width: string; - /* 覆盖区域 */ area: string; }; - /** - * 初始化 Gt4 验证的请求参数 - * @since Beta v0.8.7 - */ type InitGeetest4Params = { /* 验证ID */ captchaId: string; @@ -106,26 +109,33 @@ declare namespace TGApp.BBS.Geetest { }; /** - * GeetestCaptcha 对象 - * @since Beta v0.8.7 + * @description Geetest 插件 captchaObj + * @since Beta v0.8.3 + * @interface GeetestCaptcha + * @property {Function} appendTo + * @property {Function} getValidate + * @property {Function} onClose + * @property {Function} onReady */ type GeetestCaptcha = { - /* 将验证码添加到指定的选择器中 */ appendTo: (selector: string) => void; - /* 获取验证结果 */ getValidate: () => Promise; - /* 关闭回调 */ onClose: (callback: () => void) => boolean; - /* 准备就绪回调 */ onReady: (callback: () => void) => void; - /* 成功回调 */ onSuccess: (callback: () => void) => void; }; /** - * 验证成功返回数据 - * @since Beta v0.8.7 - * @remarks 由于目前都是直接转 base64 字符串返回,故类型定义为 unknown + * @description Geetest 插件 validate + * @since Beta v0.7.1 + * @interface GeetestVerifyRes + * @property {string} geetest_challenge + * @property {string} geetest_validate + * @property {string} geetest_seccode */ - type GeetestVerifyRes = unknown; + type GeetestVerifyRes = { + geetest_challenge: string; + geetest_validate: string; + geetest_seccode: string; + }; } diff --git a/src/utils/TGWindow.ts b/src/utils/TGWindow.ts index 6f821905..0853ece9 100644 --- a/src/utils/TGWindow.ts +++ b/src/utils/TGWindow.ts @@ -1,6 +1,7 @@ /** - * 窗口创建相关工具 - * @since Beta v0.8.7 + * @file utils/TGWindow.ts + * @description 窗口创建相关工具函数 + * @since Beta v0.7.9 */ import type { RenderCard } from "@comp/app/t-postcard.vue"; @@ -100,8 +101,8 @@ export function getWindowSize(label: string): PhysicalSize { } /** - * 窗口适配 - * @since Beta v0.8.7 + * @description 窗口适配 + * @since Beta v0.7.9 * @returns Promise */ export async function resizeWindow(): Promise { @@ -118,7 +119,7 @@ export async function resizeWindow(): Promise { const targetWidth = Math.round(designSize.width * widthScale); const targetHeight = Math.round(designSize.height * heightScale); await windowCur.setSize(new PhysicalSize(targetWidth, targetHeight)); - const targetZoom = Math.min(widthScale, heightScale); + const targetZoom = Math.min(widthScale, heightScale) / screen.scaleFactor; await windowCur.setZoom(targetZoom); await windowCur.setFocus(); }