From f7c49ed9e68aab57198568fd9a50ffe94d14414b Mon Sep 17 00:00:00 2001 From: anghunk Date: Fri, 30 Jan 2026 23:05:48 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=BB=9F=E4=B8=80=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=B9=B6=E4=BF=AE=E5=A4=8D=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 env.d.ts 和 vite.config.ts 中多余的空行 - 修复 package.json 和 tsconfig.json 的换行符问题 - 标准化对象字面量和函数参数中的尾部逗号 - 将登录图标样式从 max-width 改为明确的 width 和 height - 压缩 index.html 中 favicon 链接的格式 - 简化 admin.ts 中函数参数的类型声明格式 --- cwd-admin/index.html | 3 +-- cwd-admin/package.json | 2 +- cwd-admin/src/api/admin.ts | 13 +++---------- cwd-admin/src/api/http.ts | 2 +- cwd-admin/src/env.d.ts | 1 - cwd-admin/src/styles/components/login.less | 3 ++- cwd-admin/tsconfig.json | 16 +++++++++++----- cwd-admin/vite.config.ts | 5 ++--- 8 files changed, 21 insertions(+), 24 deletions(-) diff --git a/cwd-admin/index.html b/cwd-admin/index.html index be00808..7534d23 100644 --- a/cwd-admin/index.html +++ b/cwd-admin/index.html @@ -4,8 +4,7 @@ - + CWD 评论系统 diff --git a/cwd-admin/package.json b/cwd-admin/package.json index 7d5c033..d9a35de 100644 --- a/cwd-admin/package.json +++ b/cwd-admin/package.json @@ -20,4 +20,4 @@ "vite": "^6.0.11", "vue-tsc": "^2.1.10" } -} +} \ No newline at end of file diff --git a/cwd-admin/src/api/admin.ts b/cwd-admin/src/api/admin.ts index 2d9206f..5e7afc8 100644 --- a/cwd-admin/src/api/admin.ts +++ b/cwd-admin/src/api/admin.ts @@ -174,7 +174,7 @@ export function updateComment(data: { postSlug: data.postSlug, content: data.contentText, status: data.status, - priority: data.priority + priority: data.priority, }); } @@ -323,10 +323,7 @@ export function fetchFeatureSettings(): Promise { return get('/admin/settings/features'); } -export function saveFeatureSettings(data: { - enableCommentLike?: boolean; - enableArticleLike?: boolean; -}): Promise<{ message: string }> { +export function saveFeatureSettings(data: { enableCommentLike?: boolean; enableArticleLike?: boolean }): Promise<{ message: string }> { return put<{ message: string }>('/admin/settings/features', data); } @@ -340,11 +337,7 @@ export function fetchTelegramSettings(): Promise { return get('/admin/settings/telegram'); } -export function saveTelegramSettings(data: { - botToken?: string; - chatId?: string; - notifyEnabled?: boolean; -}): Promise<{ message: string }> { +export function saveTelegramSettings(data: { botToken?: string; chatId?: string; notifyEnabled?: boolean }): Promise<{ message: string }> { return put<{ message: string }>('/admin/settings/telegram', data); } diff --git a/cwd-admin/src/api/http.ts b/cwd-admin/src/api/http.ts index fd7f51f..1213f8d 100644 --- a/cwd-admin/src/api/http.ts +++ b/cwd-admin/src/api/http.ts @@ -25,7 +25,7 @@ async function request(method: HttpMethod, path: string, body?: unknown): Pro const res = await fetch(`${apiBaseUrl}${path}`, { method, headers, - body: body !== undefined ? JSON.stringify(body) : undefined + body: body !== undefined ? JSON.stringify(body) : undefined, }); let data: any = null; try { diff --git a/cwd-admin/src/env.d.ts b/cwd-admin/src/env.d.ts index fd5d2e7..284e3cc 100644 --- a/cwd-admin/src/env.d.ts +++ b/cwd-admin/src/env.d.ts @@ -7,4 +7,3 @@ interface ImportMetaEnv { interface ImportMeta { readonly env: ImportMetaEnv; } - diff --git a/cwd-admin/src/styles/components/login.less b/cwd-admin/src/styles/components/login.less index 438447b..b9097c7 100644 --- a/cwd-admin/src/styles/components/login.less +++ b/cwd-admin/src/styles/components/login.less @@ -23,7 +23,8 @@ } .login-icon { - max-width: 80px; + width: 80px; + height: 80px; display: block; margin: 0 auto; margin-bottom: 10px; diff --git a/cwd-admin/tsconfig.json b/cwd-admin/tsconfig.json index f932362..8832598 100644 --- a/cwd-admin/tsconfig.json +++ b/cwd-admin/tsconfig.json @@ -9,12 +9,18 @@ "resolveJsonModule": true, "isolatedModules": true, "esModuleInterop": true, - "lib": ["ESNext", "DOM"], + "lib": [ + "ESNext", + "DOM" + ], "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "noEmit": true, - "types": ["vite/client"] + "types": [ + "vite/client" + ] }, - "include": ["src"] -} - + "include": [ + "src" + ] +} \ No newline at end of file diff --git a/cwd-admin/vite.config.ts b/cwd-admin/vite.config.ts index 60c8c59..f6f86a5 100644 --- a/cwd-admin/vite.config.ts +++ b/cwd-admin/vite.config.ts @@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue'; export default defineConfig({ plugins: [vue()], server: { - port: 1226 - } + port: 1226, + }, }); -