From ae2ba8a916f4dbec2bf50b0e3fa3527ca4fd740a Mon Sep 17 00:00:00 2001 From: yourname Date: Thu, 15 May 2025 03:36:20 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=96=87=E4=BB=B6=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=90=8E=E7=AB=AFapi=E8=B7=AF=E7=94=B1=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=A1=A8=E5=90=8D=E4=B8=BAfile=5Fcategories=20?= =?UTF-8?q?=E5=B0=86react=E7=89=88=E6=9C=AC=E9=99=8D=E4=B8=BA18.3.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HISTORY.md | 4 ++++ deno.json | 26 ++++++++++++-------------- server/routes_file_category.ts | 10 +++++----- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 84f581f..910a0b5 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,10 @@ 待实现 迁移管理页面,在正式环境中,需要验证env中配置的密码参数才能打开 +2025.05.15 0.1.6 +修正文件分类后端api路由查询表名为file_categories +将react版本降为18.3.1 + 2025.05.14 0.1.5 优化ErrorPage样式,补充了NotFoundPage deno.json中去掉 没用的 @testing-library,jsDom diff --git a/deno.json b/deno.json index 2b332e8..0241c83 100644 --- a/deno.json +++ b/deno.json @@ -17,20 +17,18 @@ "@d8d-appcontainer/types": "https://esm.d8d.fun/@d8d-appcontainer/types@3.0.47", "@d8d-appcontainer/api": "https://esm.d8d.fun/@d8d-appcontainer/api@3.0.47", "lodash": "https://esm.d8d.fun/lodash@4.17.21", - "react": "https://esm.d8d.fun/react@19.0.0?dev", - "react-dom": "https://esm.d8d.fun/react-dom@19.0.0?dev", - "react-dom/client": "https://esm.d8d.fun/react-dom@19.0.0/client?dev", - "react-router": "https://esm.d8d.fun/react-router@7.3.0?dev&deps=react@19.0.0,react-dom@19.0.0", - "antd": "https://esm.d8d.fun/antd@5.24.6?dev&standalone&deps=react@19.0.0,react-dom@19.0.0", - "@ant-design/v5-patch-for-react-19":"https://esm.d8d.fun/@ant-design/v5-patch-for-react-19@1.0.3?dev&standalone&deps=react@19.0.0,react-dom@19.0.0", - "antd/locale/zh_CN": "https://esm.d8d.fun/antd@5.24.5/locale/zh_CN?dev&standalone&deps=react@19.0.0,react-dom@19.0.0", - "@ant-design/icons": "https://esm.d8d.fun/@ant-design/icons@5.6.1?dev&standalone&deps=react@19.0.0,react-dom@19.0.0", - "@tanstack/react-query": "https://esm.d8d.fun/@tanstack/react-query@5.67.1?dev&deps=react@19.0.0,react-dom@19.0.0", - "@ant-design/plots": "https://esm.d8d.fun/@ant-design/plots@2.1.13?dev&deps=react@19.0.0,react-dom@19.0.0", - "react-hook-form": "https://esm.d8d.fun/react-hook-form@7.55.0?dev&deps=react@19.0.0,react-dom@19.0.0", - "@heroicons/react/24/outline": "https://esm.d8d.fun/@heroicons/react@2.1.1/24/outline?dev&deps=react@19.0.0,react-dom@19.0.0", - "@heroicons/react/24/solid": "https://esm.d8d.fun/@heroicons/react@2.1.1/24/solid?dev&deps=react@19.0.0,react-dom@19.0.0", - "@testing-library/react": "https://esm.d8d.fun/@testing-library/react@16.3.0?dev&deps=react@19.0.0,react-dom@19.0.0" + "react": "https://esm.d8d.fun/react@18.3.1?dev", + "react-dom": "https://esm.d8d.fun/react-dom@18.3.1?dev", + "react-dom/client": "https://esm.d8d.fun/react-dom@18.3.1/client?dev", + "react-router": "https://esm.d8d.fun/react-router@7.3.0?dev&deps=react@18.3.1,react-dom@18.3.1", + "antd": "https://esm.d8d.fun/antd@5.24.6?dev&standalone&deps=react@18.3.1,react-dom@18.3.1", + "antd/locale/zh_CN": "https://esm.d8d.fun/antd@5.24.5/locale/zh_CN?dev&standalone&deps=react@18.3.1,react-dom@18.3.1", + "@ant-design/icons": "https://esm.d8d.fun/@ant-design/icons@5.6.1?dev&standalone&deps=react@18.3.1,react-dom@18.3.1", + "@tanstack/react-query": "https://esm.d8d.fun/@tanstack/react-query@5.67.1?dev&deps=react@18.3.1,react-dom@18.3.1", + "@ant-design/plots": "https://esm.d8d.fun/@ant-design/plots@2.1.13?dev&deps=react@18.3.1,react-dom@18.3.1", + "react-hook-form": "https://esm.d8d.fun/react-hook-form@7.55.0?dev&deps=react@18.3.1,react-dom@18.3.1", + "@heroicons/react/24/outline": "https://esm.d8d.fun/@heroicons/react@2.1.1/24/outline?dev&deps=react@18.3.1,react-dom@18.3.1", + "@heroicons/react/24/solid": "https://esm.d8d.fun/@heroicons/react@2.1.1/24/solid?dev&deps=react@18.3.1,react-dom@18.3.1" }, "compilerOptions": { "lib": ["dom", "dom.iterable", "esnext", "deno.ns"] diff --git a/server/routes_file_category.ts b/server/routes_file_category.ts index cd84b9b..975e3c2 100644 --- a/server/routes_file_category.ts +++ b/server/routes_file_category.ts @@ -11,7 +11,7 @@ import { import type { Variables, WithAuth } from "./middlewares.ts"; const log = { - api: debug("api:sys"), + api: debug("api:file_categories"), }; // 创建文件分类路由 @@ -29,7 +29,7 @@ export function createFileCategoryRoutes(withAuth: WithAuth) { const search = c.req.query("search") || ""; - let query = apiClient.database.table("file_category").orderBy("id", "desc"); + let query = apiClient.database.table("file_categories").orderBy("id", "desc"); if (search) { query = query.where("name", "like", `%${search}%`); @@ -66,7 +66,7 @@ export function createFileCategoryRoutes(withAuth: WithAuth) { } // 插入文件分类 - const [id] = await apiClient.database.table("file_category").insert({ + const [id] = await apiClient.database.table("file_categories").insert({ ...data, created_at: apiClient.database.fn.now(), updated_at: apiClient.database.fn.now(), @@ -99,7 +99,7 @@ export function createFileCategoryRoutes(withAuth: WithAuth) { // 更新文件分类 await apiClient.database - .table("file_category") + .table("file_categories") .where("id", id) .update({ ...data, @@ -129,7 +129,7 @@ export function createFileCategoryRoutes(withAuth: WithAuth) { return c.json({ error: "无效的分类ID" }, 400); } - await apiClient.database.table("file_category").where("id", id).update({ + await apiClient.database.table("file_categories").where("id", id).update({ is_deleted: DeleteStatus.DELETED, updated_at: apiClient.database.fn.now(), });