style: 统一代码格式并修复样式问题
- 移除 env.d.ts 和 vite.config.ts 中多余的空行 - 修复 package.json 和 tsconfig.json 的换行符问题 - 标准化对象字面量和函数参数中的尾部逗号 - 将登录图标样式从 max-width 改为明确的 width 和 height - 压缩 index.html 中 favicon 链接的格式 - 简化 admin.ts 中函数参数的类型声明格式
This commit is contained in:
@@ -4,8 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="shortcut icon" href="https://cwd.js.org/icon.png"
|
<link rel="shortcut icon" href="https://cwd.js.org/icon.png" type="image/x-icon">
|
||||||
type="image/x-icon">
|
|
||||||
<title>CWD 评论系统</title>
|
<title>CWD 评论系统</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -20,4 +20,4 @@
|
|||||||
"vite": "^6.0.11",
|
"vite": "^6.0.11",
|
||||||
"vue-tsc": "^2.1.10"
|
"vue-tsc": "^2.1.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ export function updateComment(data: {
|
|||||||
postSlug: data.postSlug,
|
postSlug: data.postSlug,
|
||||||
content: data.contentText,
|
content: data.contentText,
|
||||||
status: data.status,
|
status: data.status,
|
||||||
priority: data.priority
|
priority: data.priority,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,10 +323,7 @@ export function fetchFeatureSettings(): Promise<FeatureSettingsResponse> {
|
|||||||
return get<FeatureSettingsResponse>('/admin/settings/features');
|
return get<FeatureSettingsResponse>('/admin/settings/features');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function saveFeatureSettings(data: {
|
export function saveFeatureSettings(data: { enableCommentLike?: boolean; enableArticleLike?: boolean }): Promise<{ message: string }> {
|
||||||
enableCommentLike?: boolean;
|
|
||||||
enableArticleLike?: boolean;
|
|
||||||
}): Promise<{ message: string }> {
|
|
||||||
return put<{ message: string }>('/admin/settings/features', data);
|
return put<{ message: string }>('/admin/settings/features', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,11 +337,7 @@ export function fetchTelegramSettings(): Promise<TelegramSettingsResponse> {
|
|||||||
return get<TelegramSettingsResponse>('/admin/settings/telegram');
|
return get<TelegramSettingsResponse>('/admin/settings/telegram');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function saveTelegramSettings(data: {
|
export function saveTelegramSettings(data: { botToken?: string; chatId?: string; notifyEnabled?: boolean }): Promise<{ message: string }> {
|
||||||
botToken?: string;
|
|
||||||
chatId?: string;
|
|
||||||
notifyEnabled?: boolean;
|
|
||||||
}): Promise<{ message: string }> {
|
|
||||||
return put<{ message: string }>('/admin/settings/telegram', data);
|
return put<{ message: string }>('/admin/settings/telegram', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ async function request<T>(method: HttpMethod, path: string, body?: unknown): Pro
|
|||||||
const res = await fetch(`${apiBaseUrl}${path}`, {
|
const res = await fetch(`${apiBaseUrl}${path}`, {
|
||||||
method,
|
method,
|
||||||
headers,
|
headers,
|
||||||
body: body !== undefined ? JSON.stringify(body) : undefined
|
body: body !== undefined ? JSON.stringify(body) : undefined,
|
||||||
});
|
});
|
||||||
let data: any = null;
|
let data: any = null;
|
||||||
try {
|
try {
|
||||||
|
|||||||
1
cwd-admin/src/env.d.ts
vendored
1
cwd-admin/src/env.d.ts
vendored
@@ -7,4 +7,3 @@ interface ImportMetaEnv {
|
|||||||
interface ImportMeta {
|
interface ImportMeta {
|
||||||
readonly env: ImportMetaEnv;
|
readonly env: ImportMetaEnv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login-icon {
|
.login-icon {
|
||||||
max-width: 80px;
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|||||||
@@ -9,12 +9,18 @@
|
|||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"lib": ["ESNext", "DOM"],
|
"lib": [
|
||||||
|
"ESNext",
|
||||||
|
"DOM"
|
||||||
|
],
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"types": ["vite/client"]
|
"types": [
|
||||||
|
"vite/client"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": [
|
||||||
}
|
"src"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -4,7 +4,6 @@ import vue from '@vitejs/plugin-vue';
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
server: {
|
server: {
|
||||||
port: 1226
|
port: 1226,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user