diff --git a/src/components/app/t-sidebar.vue b/src/components/app/t-sidebar.vue index 68ec2b60..de7f2fb1 100644 --- a/src/components/app/t-sidebar.vue +++ b/src/components/app/t-sidebar.vue @@ -565,7 +565,7 @@ async function tryGetCaptcha(phone: string, aigis?: string): Promise((resolve) => setTimeout(resolve, 3000)); return false; } const aigisResp: TGApp.BBS.CaptchaLogin.CaptchaAigis = JSON.parse(loginResp.data); - const resp = await showGeetest(JSON.parse(aigisResp.data)); + const resp = await showGeetest(JSON.parse(aigisResp.data), aigisResp); const aigisStr = `${aigisResp.session_id};${btoa(JSON.stringify(resp))}`; return await tryLoginByCaptcha(phone, captcha, actionType, aigisStr); } diff --git a/src/components/func/geetest.vue b/src/components/func/geetest.vue index 111bf0b7..5b525342 100644 --- a/src/components/func/geetest.vue +++ b/src/components/func/geetest.vue @@ -58,6 +58,7 @@ async function displayBox( ): Promise { if ("challenge" in props) { return await new Promise((resolve) => { + console.log("initGeetest", props); initGeetest( { gt: props.gt, @@ -85,6 +86,7 @@ async function displayBox( }); } return await new Promise((resolve) => { + console.log("initGeetest4", props, raw); initGeetest4( { captchaId: props.gt, @@ -93,7 +95,7 @@ async function displayBox( nextWidth: "250px", lang: "zho", userInfo: JSON.stringify({ session_id: raw?.session_id }), - protocol: "https", + https: true, }, (captchaObj: TGApp.BBS.Geetest.GeetestCaptcha) => { if (geetestEl.value === null) return; diff --git a/src/types/BBS/Geetest.d.ts b/src/types/BBS/Geetest.d.ts index 22885c92..62982aab 100644 --- a/src/types/BBS/Geetest.d.ts +++ b/src/types/BBS/Geetest.d.ts @@ -1,6 +1,6 @@ /** * 极验验证相关类型定义文件 - * @since Beta v0.8.7 + * @since Beta v0.9.5 */ declare namespace TGApp.BBS.Geetest { @@ -90,7 +90,7 @@ declare namespace TGApp.BBS.Geetest { /** * 初始化 Gt4 验证的请求参数 - * @since Beta v0.8.7 + * @since Beta v0.9.5 */ type InitGeetest4Params = { /** 验证ID */ @@ -107,6 +107,13 @@ declare namespace TGApp.BBS.Geetest { lang: string; /** 协议头 */ protocol: string; + /** + * 使用 https 协议 + * @remarks 改配置在部署文档中未提及但是在 js 中具有 + * - 部署文档:https://docs.geetest.com/gt4/apirefer/api/web#%E9%85%8D%E7%BD%AE%E5%8F%82%E6%95%B0 + * - JS: https://static.geetest.com/v4/gt4.js + */ + https: boolean; }; /**