docs: explain configuration inputs and authentication components

This commit is contained in:
cieanyau committed 2026-11-06 00:29:13 +08:00
1 parent dc32a74d7a
commit 3a53d2e58f
19 files changed
+72

No files matched your search

+6
View File
@@ -1,4 +1,5 @@
<script>
/** 极验 V4 浏览器适配:脚本加载复用,但每轮挑战独立创建/销毁,通过 verified 回传四项证明字段。 */
import "~/assets/styles/GeetestField.DiieTibK.css";
import { toDisplayString } from "vue";
import { onMounted } from "vue";
@@ -22,6 +23,7 @@ function _() {
return typeof e == `function` ? e : void 0;
}
function v() {
// 合并并发脚本加载,超时或失败后清空共享 Promise,使用户可重新加载而非永久卡住。
if (typeof window > `u` || typeof document > `u`)
return Promise.reject(Error(`请在浏览器中完成人机验证`));
let e = _();
@@ -57,6 +59,7 @@ function v() {
g);
}
function y(e) {
// 仅挑选后端协议要求的非空验证字段,不透传第三方对象的额外属性。
if (!e || typeof e != `object` || Array.isArray(e)) return null;
let t = e,
n = [`lot_number`, `captcha_output`, `pass_token`, `gen_time`];
@@ -79,6 +82,7 @@ function b(e) {
].every((e) => typeof t[e] == `function`);
}
function x(e, t) {
// 单轮挑战生命周期;销毁幂等,迟到或重复的 SDK 实例也要释放,避免遗留验证浮层。
let n = !1,
r = !1,
i = !1,
@@ -259,6 +263,7 @@ var S = {
(v++, _?.destroy(), (_ = null));
}
function j(e = !1) {
// 重建时先通知父级旧证明无效,再以代次验证 SDK 回调,拒绝旧挑战覆盖新状态。
if ((A(), m(`invalid`), (g.value = ``), !y || p.disabled)) {
h.value = `idle`;
return;
@@ -290,6 +295,7 @@ var S = {
});
}
function M() {
// 必须由用户点击显示 bind 验证面板;组件未就绪时先加载,准备完成后再打开。
if (!(p.disabled || k.value)) {
if (!_) {
j(!0);