From e31ee5c6a7a0b805af7a2353fd1290a5a8e0a586 Mon Sep 17 00:00:00 2001 From: zuohuaijun Date: Sun, 23 Mar 2025 23:06:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=8E1=E3=80=81=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E7=BC=96=E8=BE=91=E6=97=B6=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=20=202=E3=80=81=E5=A2=9E=E5=8A=A0openapi-ts-?= =?UTF-8?q?request=E7=BB=84=E4=BB=B6=20=203=E3=80=81=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj | 10 +++++----- Web/openapi-ts-request.config.ts | 7 +++++++ Web/package.json | 4 +++- Web/src/views/system/org/component/editOrg.vue | 1 - Web/src/views/system/org/index.vue | 8 ++++---- 5 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 Web/openapi-ts-request.config.ts diff --git a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj index fb60b6f8..3d3c6e48 100644 --- a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj +++ b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj @@ -28,9 +28,9 @@ - - - + + + @@ -73,8 +73,8 @@ - - + + diff --git a/Web/openapi-ts-request.config.ts b/Web/openapi-ts-request.config.ts new file mode 100644 index 00000000..816f66d6 --- /dev/null +++ b/Web/openapi-ts-request.config.ts @@ -0,0 +1,7 @@ +import type { GenerateServiceProps } from 'openapi-ts-request'; + +export default { + schemaPath: 'http://localhost:5005/swagger/Default/swagger.json', // swagger.json 文件路径 + serversPath: './src/apis', // 接口文件路径 + requestLibPath: 'import request from "/@/utils/axios-utils"', // 请求方法路径 +} as GenerateServiceProps; diff --git a/Web/package.json b/Web/package.json index 00dd4ab0..9c5760ce 100644 --- a/Web/package.json +++ b/Web/package.json @@ -14,7 +14,8 @@ "build-api": "cd api_build/ && build.bat", "build-approvalFlow-api": "cd api_build/ && build.bat approvalFlow", "build-dingTalk-api": "cd api_build/ && build.bat dingTalk", - "build-goView-api": "cd api_build/ && build.bat goView" + "build-goView-api": "cd api_build/ && build.bat goView", + "openapi": "openapi-ts" }, "dependencies": { "@element-plus/icons-vue": "^2.3.1", @@ -100,6 +101,7 @@ "eslint-plugin-vue": "^10.0.0", "globals": "^16.0.0", "less": "^4.2.2", + "openapi-ts-request": "^1.2.0", "prettier": "^3.5.3", "rollup-plugin-visualizer": "^5.14.0", "sass": "^1.86.0", diff --git a/Web/src/views/system/org/component/editOrg.vue b/Web/src/views/system/org/component/editOrg.vue index 069c21fd..3398ceb5 100644 --- a/Web/src/views/system/org/component/editOrg.vue +++ b/Web/src/views/system/org/component/editOrg.vue @@ -97,7 +97,6 @@ const cascaderProps = { checkStrictly: true, emitPath: false, value: 'id', label onMounted(async () => { let resDicData = await getAPI(SysDictDataApi).apiSysDictDataDataListCodeGet('org_type'); state.orgTypeList = resDicData.data.result; - console.log(state.orgTypeList); }); // 打开弹窗 diff --git a/Web/src/views/system/org/index.vue b/Web/src/views/system/org/index.vue index 00e2d106..867ed1cc 100644 --- a/Web/src/views/system/org/index.vue +++ b/Web/src/views/system/org/index.vue @@ -9,19 +9,19 @@ - + - + - + - +