🚧 继续调试验证

This commit is contained in:
BTMuli
2023-10-02 22:56:12 +08:00
parent b3bbd4bed7
commit 49c716f009
3 changed files with 12 additions and 13 deletions

View File

@@ -5,7 +5,7 @@
*/
import { h, render, type VNode } from "vue";
import geetest, { type GeetestParam } from "./geetest.vue";
import geetest from "./geetest.vue";
const geetestId = "tg-func-geetest";
@@ -20,13 +20,13 @@ const renderBox = (): VNode => {
let geetestInstance: VNode;
const showGeetest = async (props: GeetestParam): Promise<string | boolean> => {
const showGeetest = async (): Promise<boolean> => {
if (geetestInstance) {
const boxVue = geetestInstance.component;
return boxVue?.exposeProxy?.displayBox();
} else {
geetestInstance = renderBox();
return await showGeetest(props);
return await showGeetest();
}
};

View File

@@ -26,10 +26,6 @@ const showInner = ref<boolean>(false);
const userStore = useUserStore();
export interface GeetestParam {
urlOri: string;
}
const geetestRef = ref<HTMLElement>(<HTMLElement>document.getElementById("geetest"));
watch(show, () => {
@@ -48,7 +44,7 @@ watch(show, () => {
}
});
async function displayBox(urlOri: string): Promise<boolean> {
async function displayBox(): Promise<boolean> {
const cookie = userStore.getCookieGroup3();
const res = await TGRequest.User.verification.get(cookie.ltoken, cookie.ltuid);
if ("retcode" in res) {
@@ -76,7 +72,7 @@ async function displayBox(urlOri: string): Promise<boolean> {
captchaObj.appendTo("#geetest");
captchaObj.onSuccess(async () => {
const validate = captchaObj.getValidate();
const res = TGRequest.User.verification.verify(urlOri, userStore.cookie, validate);
const res = TGRequest.User.verification.verify(userStore.cookie, validate);
resolve(res);
});
captchaObj.onClose(() => {