From da2002f6d08cce44268b0f7081a4478ffafacd14 Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Fri, 16 Jan 2026 23:19:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E4=BB=B6=E4=B9=B1=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=8C=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=8C=87=E5=AE=9Ats=E7=B1=BB=E5=9E=8B=EF=BC=8C=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=A7=BB=E9=99=A4=E7=A7=9F=E6=88=B7=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/codegen.ts | 22 ++++- src/components/DictSelect/index.vue | 4 +- src/components/DictTag/index.vue | 12 +-- src/layouts/components/LayoutNavbar.vue | 4 +- src/layouts/components/LayoutSidebar.vue | 36 +++---- src/layouts/components/LayoutToolbar.vue | 14 +-- src/types/api/user.ts | 2 + src/views/codegen/index.vue | 10 +- src/views/login/components/Login.vue | 114 +---------------------- 9 files changed, 65 insertions(+), 153 deletions(-) diff --git a/src/api/codegen.ts b/src/api/codegen.ts index 8115b7fb..af2c1a57 100644 --- a/src/api/codegen.ts +++ b/src/api/codegen.ts @@ -31,11 +31,18 @@ const GeneratorAPI = { }, /** 获取代码生成预览数据 */ - getPreviewData(tableName: string, pageType?: "classic" | "curd") { + getPreviewData(tableName: string, pageType?: "classic" | "curd", type?: "ts" | "js") { + const params: Record = {}; + if (pageType) { + params.pageType = pageType; + } + if (type) { + params.type = type; + } return request({ url: `${GENERATOR_BASE_URL}/${tableName}/preview`, method: "get", - params: pageType ? { pageType } : undefined, + params: Object.keys(params).length ? params : undefined, }); }, @@ -52,11 +59,18 @@ const GeneratorAPI = { * @param url * @param fileName */ - download(tableName: string, pageType?: "classic" | "curd") { + download(tableName: string, pageType?: "classic" | "curd", type?: "ts" | "js") { + const params: Record = {}; + if (pageType) { + params.pageType = pageType; + } + if (type) { + params.type = type; + } return request({ url: `${GENERATOR_BASE_URL}/${tableName}/download`, method: "get", - params: pageType ? { pageType } : undefined, + params: Object.keys(params).length ? params : undefined, responseType: "blob", }).then((response) => { const contentDisposition = response?.headers?.["content-disposition"] as string | undefined; diff --git a/src/components/DictSelect/index.vue b/src/components/DictSelect/index.vue index 7349fb75..e5ddce09 100644 --- a/src/components/DictSelect/index.vue +++ b/src/components/DictSelect/index.vue @@ -1,4 +1,4 @@ -