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

+10
View File
@@ -1,4 +1,8 @@
<script>
/**
* 登录页的微信扫码入口:申请二维码、轮询扫码状态、选择关联账号或转入绑定流程。
* 二维码轮询与倒计时共享代次 K;切换入口、收窄视口或卸载都使旧请求失效。
*/
import "~/assets/styles/AuthProviders.CgAWouSf.css";
import { toDisplayString } from "vue";
import { renderList } from "vue";
@@ -137,6 +141,7 @@ var fe = {
(G !== null && (clearInterval(G), (G = null)), (U.value = 0));
}
function Ee() {
// 扫码状态每两秒查询;二维码按服务端到期时间提前五秒刷新,缺省有效期为五分钟。
(J(), Y(), (W = window.setInterval(De, 2e3)));
let e = Math.floor(Date.now() / 1e3),
t = I.value?.expire_time ? I.value.expire_time - e : Ce;
@@ -146,6 +151,7 @@ var fe = {
}, 1e3)));
}
async function X() {
// 只在桌面展示区域申请新二维码,并核对图片、ticket 与 token 的完整性。
if (!k.value || L.value) return;
let e = ++K;
(Z(),
@@ -180,6 +186,7 @@ var fe = {
}
}
async function De() {
// 同一代次最多一个查询在途;Wait/Success/Expired/SelectClient/WaitBind 分别处理。
if (!I.value || q === K) return;
let e = K,
t = I.value;
@@ -259,6 +266,7 @@ var fe = {
(J(), Y());
}
function Q() {
// 同时废弃二维码和关联账号选择,不能让旧 ticket 在新一次扫码中继续使用。
(K++,
Z(),
(I.value = null),
@@ -270,6 +278,7 @@ var fe = {
(V.value = null));
}
function $(e) {
// 成功响应仍需经过 JWT 格式校验,登录完成后的返回路径由统一安全跳转规则约束。
if ((Z(), !isValidJwt(e))) {
z.value = `登录响应无效,请重新扫码;若持续失败,请联系客服。`;
return;
@@ -277,6 +286,7 @@ var fe = {
(C.loginWithJwt(e), K++, T.push(auth_redirect_r(w.query.redirect)));
}
async function Oe() {
// 多账号扫码只能提交当前返回列表中明确可登录的账号,且请求绑定当前二维码代次。
if (H.value) return;
if (
!I.value ||