diff --git a/.gitignore b/.gitignore index 9c27e8d..6704881 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,8 @@ /frontend/.vscode/ /frontend/.idea/ /开发路径.md +**/__pycache__/ +**/*.pyc +**/logs/ +**/logs/*.log diff --git a/backend/app/__pycache__/__init__.cpython-312.pyc b/backend/app/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index fc45964..0000000 Binary files a/backend/app/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/backend/app/api/__pycache__/__init__.cpython-312.pyc b/backend/app/api/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 282357f..0000000 Binary files a/backend/app/api/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/backend/app/api/__pycache__/api.cpython-312.pyc b/backend/app/api/__pycache__/api.cpython-312.pyc deleted file mode 100644 index bbb1133..0000000 Binary files a/backend/app/api/__pycache__/api.cpython-312.pyc and /dev/null differ diff --git a/backend/app/api/endpoints/__pycache__/__init__.cpython-312.pyc b/backend/app/api/endpoints/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 9924643..0000000 Binary files a/backend/app/api/endpoints/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/backend/app/api/endpoints/__pycache__/auth.cpython-312.pyc b/backend/app/api/endpoints/__pycache__/auth.cpython-312.pyc deleted file mode 100644 index 553affb..0000000 Binary files a/backend/app/api/endpoints/__pycache__/auth.cpython-312.pyc and /dev/null differ diff --git a/backend/app/api/endpoints/__pycache__/comments.cpython-312.pyc b/backend/app/api/endpoints/__pycache__/comments.cpython-312.pyc deleted file mode 100644 index e036b18..0000000 Binary files a/backend/app/api/endpoints/__pycache__/comments.cpython-312.pyc and /dev/null differ diff --git a/backend/app/api/endpoints/__pycache__/posts.cpython-312.pyc b/backend/app/api/endpoints/__pycache__/posts.cpython-312.pyc deleted file mode 100644 index 318a68c..0000000 Binary files a/backend/app/api/endpoints/__pycache__/posts.cpython-312.pyc and /dev/null differ diff --git a/backend/app/api/endpoints/__pycache__/users.cpython-312.pyc b/backend/app/api/endpoints/__pycache__/users.cpython-312.pyc deleted file mode 100644 index 9d1e4fa..0000000 Binary files a/backend/app/api/endpoints/__pycache__/users.cpython-312.pyc and /dev/null differ diff --git a/backend/app/core/__pycache__/__init__.cpython-312.pyc b/backend/app/core/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 4e0132b..0000000 Binary files a/backend/app/core/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/backend/app/core/__pycache__/config.cpython-312.pyc b/backend/app/core/__pycache__/config.cpython-312.pyc deleted file mode 100644 index 45b44d9..0000000 Binary files a/backend/app/core/__pycache__/config.cpython-312.pyc and /dev/null differ diff --git a/backend/app/core/__pycache__/database.cpython-312.pyc b/backend/app/core/__pycache__/database.cpython-312.pyc deleted file mode 100644 index 539a79a..0000000 Binary files a/backend/app/core/__pycache__/database.cpython-312.pyc and /dev/null differ diff --git a/backend/app/core/__pycache__/logger.cpython-312.pyc b/backend/app/core/__pycache__/logger.cpython-312.pyc deleted file mode 100644 index 6212234..0000000 Binary files a/backend/app/core/__pycache__/logger.cpython-312.pyc and /dev/null differ diff --git a/backend/app/core/__pycache__/security.cpython-312.pyc b/backend/app/core/__pycache__/security.cpython-312.pyc deleted file mode 100644 index 0adb690..0000000 Binary files a/backend/app/core/__pycache__/security.cpython-312.pyc and /dev/null differ diff --git a/backend/app/crud/__pycache__/__init__.cpython-312.pyc b/backend/app/crud/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 79186f9..0000000 Binary files a/backend/app/crud/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/backend/app/crud/__pycache__/category.cpython-312.pyc b/backend/app/crud/__pycache__/category.cpython-312.pyc deleted file mode 100644 index ba8cc07..0000000 Binary files a/backend/app/crud/__pycache__/category.cpython-312.pyc and /dev/null differ diff --git a/backend/app/crud/__pycache__/comment.cpython-312.pyc b/backend/app/crud/__pycache__/comment.cpython-312.pyc deleted file mode 100644 index 7661459..0000000 Binary files a/backend/app/crud/__pycache__/comment.cpython-312.pyc and /dev/null differ diff --git a/backend/app/crud/__pycache__/post.cpython-312.pyc b/backend/app/crud/__pycache__/post.cpython-312.pyc deleted file mode 100644 index 33e33ef..0000000 Binary files a/backend/app/crud/__pycache__/post.cpython-312.pyc and /dev/null differ diff --git a/backend/app/crud/__pycache__/tag.cpython-312.pyc b/backend/app/crud/__pycache__/tag.cpython-312.pyc deleted file mode 100644 index 3afbb15..0000000 Binary files a/backend/app/crud/__pycache__/tag.cpython-312.pyc and /dev/null differ diff --git a/backend/app/crud/__pycache__/user.cpython-312.pyc b/backend/app/crud/__pycache__/user.cpython-312.pyc deleted file mode 100644 index ad533ca..0000000 Binary files a/backend/app/crud/__pycache__/user.cpython-312.pyc and /dev/null differ diff --git a/backend/app/models/__pycache__/__init__.cpython-312.pyc b/backend/app/models/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index a5a60ca..0000000 Binary files a/backend/app/models/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/backend/app/models/__pycache__/category.cpython-312.pyc b/backend/app/models/__pycache__/category.cpython-312.pyc deleted file mode 100644 index 9582933..0000000 Binary files a/backend/app/models/__pycache__/category.cpython-312.pyc and /dev/null differ diff --git a/backend/app/models/__pycache__/comment.cpython-312.pyc b/backend/app/models/__pycache__/comment.cpython-312.pyc deleted file mode 100644 index df0babd..0000000 Binary files a/backend/app/models/__pycache__/comment.cpython-312.pyc and /dev/null differ diff --git a/backend/app/models/__pycache__/post.cpython-312.pyc b/backend/app/models/__pycache__/post.cpython-312.pyc deleted file mode 100644 index f436491..0000000 Binary files a/backend/app/models/__pycache__/post.cpython-312.pyc and /dev/null differ diff --git a/backend/app/models/__pycache__/tag.cpython-312.pyc b/backend/app/models/__pycache__/tag.cpython-312.pyc deleted file mode 100644 index 308e115..0000000 Binary files a/backend/app/models/__pycache__/tag.cpython-312.pyc and /dev/null differ diff --git a/backend/app/models/__pycache__/user.cpython-312.pyc b/backend/app/models/__pycache__/user.cpython-312.pyc deleted file mode 100644 index d99bef4..0000000 Binary files a/backend/app/models/__pycache__/user.cpython-312.pyc and /dev/null differ diff --git a/backend/app/schemas/__pycache__/__init__.cpython-312.pyc b/backend/app/schemas/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 27a4d27..0000000 Binary files a/backend/app/schemas/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/backend/app/schemas/__pycache__/auth.cpython-312.pyc b/backend/app/schemas/__pycache__/auth.cpython-312.pyc deleted file mode 100644 index 124b465..0000000 Binary files a/backend/app/schemas/__pycache__/auth.cpython-312.pyc and /dev/null differ diff --git a/backend/app/schemas/__pycache__/comment.cpython-312.pyc b/backend/app/schemas/__pycache__/comment.cpython-312.pyc deleted file mode 100644 index 95fe3d5..0000000 Binary files a/backend/app/schemas/__pycache__/comment.cpython-312.pyc and /dev/null differ diff --git a/backend/app/schemas/__pycache__/post.cpython-312.pyc b/backend/app/schemas/__pycache__/post.cpython-312.pyc deleted file mode 100644 index de5d2aa..0000000 Binary files a/backend/app/schemas/__pycache__/post.cpython-312.pyc and /dev/null differ diff --git a/backend/app/schemas/__pycache__/user.cpython-312.pyc b/backend/app/schemas/__pycache__/user.cpython-312.pyc deleted file mode 100644 index 467ec8c..0000000 Binary files a/backend/app/schemas/__pycache__/user.cpython-312.pyc and /dev/null differ diff --git a/backend/logs/acg_blog_2026-03-28.log b/backend/logs/acg_blog_2026-03-28.log deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/package.json b/frontend/package.json index 2bcf4d4..b3ec041 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,8 +9,10 @@ "preview": "vite preview" }, "dependencies": { + "@kangc/v-md-editor": "^2.3.18", "@vueuse/core": "^14.2.1", "axios": "^1.13.6", + "highlight.js": "^11.10.0", "naive-ui": "^2.44.1", "pinia": "^3.0.4", "vue": "^3.5.30", diff --git a/frontend/src/api/category.ts b/frontend/src/api/category.ts new file mode 100644 index 0000000..30a5e8c --- /dev/null +++ b/frontend/src/api/category.ts @@ -0,0 +1,14 @@ +import { http } from './index' +import type { Category } from '@/types' + +export const categoryApi = { + // 获取所有分类 + getAll() { + return http.get('/categories') + }, + + // 获取单个分类 + getDetail(id: string) { + return http.get(`/categories/${id}`) + }, +} diff --git a/frontend/src/components/MarkdownEditor.vue b/frontend/src/components/MarkdownEditor.vue new file mode 100644 index 0000000..6de9e26 --- /dev/null +++ b/frontend/src/components/MarkdownEditor.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/frontend/src/types/v-md-editor.d.ts b/frontend/src/types/v-md-editor.d.ts new file mode 100644 index 0000000..527e157 --- /dev/null +++ b/frontend/src/types/v-md-editor.d.ts @@ -0,0 +1,10 @@ +declare module '@kangc/v-md-editor' { + import { DefineComponent } from 'vue' + const VMdEditor: DefineComponent + export default VMdEditor +} + +declare module '@kangc/v-md-editor/lib/theme/github.js' { + const theme: any + export default theme +} diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue index a7f3e23..916455f 100644 --- a/frontend/src/views/Home.vue +++ b/frontend/src/views/Home.vue @@ -1,115 +1,54 @@