diff --git a/.env.example b/.env.example index b109896..0b82226 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,3 @@ -# Backend origin only. The client appends /console/v1. -# Leave empty when your reverse proxy serves the API on the same origin. +# 仅填写后端源地址;客户端会追加 /console/v1。 +# 反向代理在前端同源地址提供接口时留空。 NUXT_PUBLIC_API_BASE= diff --git a/.prettierignore b/.prettierignore index 2059b0c..8acd436 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,4 @@ -# Generated output and local-only reports are not source formatting targets. +# 生成产物和仅供本地使用的报告不参与源码格式化。 node_modules/ .nuxt/ .output/ @@ -8,6 +8,6 @@ tests/fixtures/runs/ docs/ .claude/skills/crashwork-ops/ -# Preserve supplied static assets and npm's lockfile serialization. +# 保留已有静态资源和 npm 锁文件的序列化格式。 public/ package-lock.json diff --git a/README.md b/README.md index cfdd717..487de5e 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,9 @@ CHROME_PATH=/absolute/path/to/chrome npm test 多数页面和组件保留恢复后的 Vue 渲染函数及部分短变量名;原始模板、注释和完整变量名无法从发布包完整找回。 当前新增注释用于解释已核实的职责、流程和接口边界,不代表找回了原作者的注释,也不代表全站重新手写。 +项目自有代码的说明性注释统一使用中文,提交信息也统一使用中文。 +变量名、接口字段、工具指令和第三方版权声明保留原样;注释应解释意图与约束,避免逐行复述代码。 + 维护时直接修改当前源码并正常构建,不要编辑生成的哈希产物。 `scripts/reconstruct.mjs` 仅是一次性导入留档,不是开发或发布步骤,且会拒绝覆盖现有页面; 不要使用不可信的第三方发布产物运行该脚本。 diff --git a/app/assets/styles/deni.css b/app/assets/styles/deni.css index c41240b..ec0a70a 100644 --- a/app/assets/styles/deni.css +++ b/app/assets/styles/deni.css @@ -2,7 +2,7 @@ * Deni shell adapted from OpenVue Foundation Deni (MIT), commit * 72156473d5f73a26f97d35aa5fed3a96059779ef: * src/assets/styles/_layout.scss, _sidebar.scss, _topbar.scss. - * Nuxt route slots, measured maintenance offset and accessible mobile focus remain local. + * Nuxt 路由插槽、维护横幅偏移测量及移动端无障碍焦点管理保留本地实现。 */ .deni-layout { min-height: 100dvh; diff --git a/app/components/PaymentDialog.vue b/app/components/PaymentDialog.vue index e6ed377..351ad83 100644 --- a/app/components/PaymentDialog.vue +++ b/app/components/PaymentDialog.vue @@ -509,7 +509,7 @@ var ue = { } async function Ht() { // 打开支付面板时并行读取订单、账户余额与渠道;订单类型决定是否再加载代金券。 - // A visible dialog can outlive session invalidation until route teardown. + // 会话失效后,支付弹窗可能直到路由卸载时才关闭,不能仅凭可见状态继续初始化。 if (!Dt.isLoggedIn) return; let e = x.orderId, t = X; diff --git a/app/config/openvue.js b/app/config/openvue.js index 66318d8..c4cf20f 100644 --- a/app/config/openvue.js +++ b/app/config/openvue.js @@ -3,7 +3,7 @@ import { definePreset } from "@openvue/themes"; import Aura from "@openvue/themes/aura"; import locale from "./locale.zh-CN.json"; -// Use the MIT theme package, with the console's blue/slate/zinc palette. +// 使用 MIT 许可的主题包,并采用控制台的 blue/slate/zinc 配色。 // 只覆盖 Aura 的语义色阶,保留组件自身设计令牌;浅色用 slate,深色用 zinc。 const preset = definePreset(Aura, { semantic: { diff --git a/app/lib/auth.js b/app/lib/auth.js index be61a5e..fa6a36f 100644 --- a/app/lib/auth.js +++ b/app/lib/auth.js @@ -244,7 +244,7 @@ async function withRequestDeadline( }, duration); }); try { - // The deadline also covers response-body decoding and any purchase preflight. + // 截止时间也覆盖响应体解码和购买预检。 return await Promise.race([ Promise.resolve().then(() => operation(controller.signal)), deadline, @@ -359,7 +359,7 @@ function useApi() { /** JSON 请求主路径:固定本次身份和请求体 → 必要时限购预检 → 请求 → 验证信封。 */ async function request(method, path, options = {}) { - // Capture identity before the first await, including when logout clears it immediately. + // 在首次 await 前捕获身份,包括退出登录立即清除身份的情况。 const requestToken = auth.token; const headers = { Accept: "application/json" }; if (requestToken) headers.Authorization = `Bearer ${requestToken}`; @@ -876,7 +876,7 @@ const useAuth = defineStore("auth", () => { // 本地退出立即生效,不等待远端吊销成功;请求已同步捕获旧 Bearer,不会误用新身份。 function logout() { - // request() captures the original Bearer synchronously; remote revocation never owns local logout. + // request() 同步捕获原始 Bearer 凭证;远端吊销不决定本地退出是否生效。 const revocation = useApi().post("/logout"); clear(); void revocation.catch(() => {}); diff --git a/app/middleware/auth.global.js b/app/middleware/auth.global.js index f983285..6cf8570 100644 --- a/app/middleware/auth.global.js +++ b/app/middleware/auth.global.js @@ -21,7 +21,7 @@ export default defineNuxtRouteMiddleware((to) => { ); const query = { ...to.query }; delete query.queryParam; - // Canonicalize the router location too; mutating query alone leaves fullPath with the credential. + // 同时规范化路由地址;仅修改 query 会让 fullPath 仍保留凭证。 return navigateTo( { path: "/home.htm", query, hash: to.hash }, { replace: true }, diff --git a/app/pages/home.htm.vue b/app/pages/home.htm.vue index c8b2523..efcc67d 100644 --- a/app/pages/home.htm.vue +++ b/app/pages/home.htm.vue @@ -28,7 +28,7 @@ async function verifyAndEnterConsole() { isVerifying.value = true; verificationError.value = ""; try { - // The route guard owns credential extraction; this page never reads it from the URL. + // 凭据提取由路由守卫负责,本页不再从 URL 读取。 await auth.verifyLegacyLogin(); if (!disposed) await router.replace("/"); } catch (error) { diff --git a/app/pages/login.vue b/app/pages/login.vue index 3b038d0..d2c969d 100644 --- a/app/pages/login.vue +++ b/app/pages/login.vue @@ -255,7 +255,7 @@ async function confirmSecurityVerification(verification) { credentials.type === "password" && captchaNeeded.value ) { - // Certification returns to this form for a fresh CAPTCHA before continuing the same login. + // 实名认证挑战后先回到当前表单刷新并完成验证码,再续交同一次登录。 pendingVerification.value = { ...verification }; securityDialogVisible.value = false; errorMessage.value = ""; @@ -407,7 +407,7 @@ async function submitLogin() {
- +
api.get("/ssh_key", { page, limit }), isCurrent, @@ -244,7 +244,7 @@ async function copyPublicKey(key) { copiedKeyId.value = key.id; copyResetTimer = setTimeout(() => (copiedKeyId.value = null), 2000); } catch { - // Clipboard access can be unavailable; the public key remains selectable. + // 剪贴板权限或接口可能不可用,用户仍可手工选择并复制公钥。 } } @@ -257,7 +257,7 @@ onBeforeUnmount(() => {