docs: annotate remaining routes layouts and view boundaries

This commit is contained in:
cieanyau committed 2026-11-06 00:34:17 +08:00
1 parent 408f8e5c98
commit ab22d406c0
56 files changed
+403

No files matched your search

+9
View File
@@ -1,4 +1,7 @@
<script setup>
/**
* 会员登录:站点配置决定手机/邮箱密码与短信入口;验证码、安全挑战及第三方登录共用会话核心。attemptVersion 隔离取消、离页和重新提交后的旧响应。
*/
import {
computed,
onBeforeUnmount,
@@ -140,6 +143,7 @@ watch([() => form.account, loginMode], () => {
errorMessage.value = "";
});
// 仅允许切换到站点已开放的登录方式;提交、发送短信或安全验证期间保持表单锁定。
function setLoginMode(mode) {
if (
fieldsDisabled.value ||
@@ -149,6 +153,7 @@ function setLoginMode(mode) {
loginMode.value = mode;
}
// 短信登录只接受手机号,发送前再次确认站点配置;倒计时和验证码挑战交给公共发送器。
function sendLoginCode() {
if (loginMode.value !== "code" || fieldsDisabled.value) return;
if (!config.value) {
@@ -167,6 +172,7 @@ function sendLoginCode() {
return sendCode("phone", account, "请输入手机号");
}
// 取消当前尝试时增加版本号并清空暂存凭据;页面卸载也调用,旧异步结果不再导航或更新反馈。
function cancelLogin() {
attemptVersion += 1;
securityDialogVisible.value = false;
@@ -177,6 +183,7 @@ function cancelLogin() {
}
onBeforeUnmount(cancelLogin);
// 使用同一份凭据快照请求登录;安全挑战保存快照等待续接,其他失败显示脱敏错误并按需刷新验证码。
async function attemptLogin(credentials, verification) {
const methodEnabled =
credentials.type === "code"
@@ -238,6 +245,7 @@ async function attemptLogin(credentials, verification) {
}
}
// 实名认证安全挑战可能要求回到原表单完成新验证码,再携带同一凭据和验证结果续交。
async function confirmSecurityVerification(verification) {
const credentials = pendingCredentials.value;
if (!credentials || submitting.value || pendingVerification.value) return;
@@ -257,6 +265,7 @@ async function confirmSecurityVerification(verification) {
await attemptLogin(credentials, verification);
}
// 区分全新登录与挑战后的续交;校验账号、登录方式、区号、口令及验证码后才创建新的登录尝试。
async function submitLogin() {
if (submitting.value || sendingCode.value || securityDialogVisible.value)
return;