规范:统一自有源码中文注释和中文提交约定
This commit is contained in:
1 parent
bdb9b00b6e
commit
83b7484558
17 files changed
+39
-36
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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: {
|
||||
|
||||
+3
-3
@@ -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(() => {});
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+2
-2
@@ -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() {
|
||||
</div>
|
||||
<div v-if="loginMode === 'code'" class="field">
|
||||
<label for="login-code">验证码</label>
|
||||
<!-- Retain the deployed scoped selectors without changing the shared stylesheet. -->
|
||||
<!-- 保留已部署样式的作用域标记,不改动共享样式表。 -->
|
||||
<div class="code-row" data-v-7896f676>
|
||||
<InputText
|
||||
id="login-code"
|
||||
|
||||
@@ -117,7 +117,7 @@ async function loadSearchResults() {
|
||||
searchLoading.value = true;
|
||||
listError.value = "";
|
||||
try {
|
||||
// Search owns the complete result set; only visibleRows applies local pagination.
|
||||
// 搜索负责收集完整结果,仅由 visibleRows 执行本地分页。
|
||||
const completeRows = await loadCompleteList(
|
||||
(page, limit) => 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(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Keep the imported page styles scoped, including the teleported editor. -->
|
||||
<!-- 保留导入样式的页面作用域,包括渲染到页面外部的编辑弹窗。 -->
|
||||
<div class="list-page" data-v-31489433>
|
||||
<div class="list-head" data-v-31489433>
|
||||
<h2 data-v-31489433>SSH 密钥</h2>
|
||||
|
||||
@@ -17,7 +17,7 @@ export default defineNuxtPlugin({
|
||||
(event.key !== null && event.key !== "jwt")
|
||||
)
|
||||
return;
|
||||
// Read the latest value: several storage events may already be queued.
|
||||
// 读取最新值:此时可能已有多个 storage 事件排队。
|
||||
const persisted = localStorage.getItem("jwt");
|
||||
if (persisted === auth.token) return;
|
||||
if (isValidJwt(persisted)) auth.prepareLogin().commit(persisted);
|
||||
|
||||
Reference in new issue
Block a user