From d12ea7dd83ee3ddaa79fe9c8efc77d06284c53d2 Mon Sep 17 00:00:00 2001 From: vertoryao <673441990@qq.com> Date: Mon, 5 May 2025 01:52:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(@vben/web-antd):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=20API=20=E8=B7=AF=E7=94=B1=E5=92=8C=E8=AF=B7=E6=B1=82=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除未使用的 repository API 导出 - 优化 PPT 和 Spider 视图中的数据处理 - 调整请求客户端的默认超时时间 - 更新 Vite 配置中的代理设置 --- apps/web-antd/src/api/core/index.ts | 1 - apps/web-antd/src/views/ppt/index.vue | 4 ++-- apps/web-antd/src/views/spider/index.vue | 5 ++--- apps/web-antd/vite.config.mts | 15 ++++++++------- .../request/src/request-client/request-client.ts | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/apps/web-antd/src/api/core/index.ts b/apps/web-antd/src/api/core/index.ts index ea85526..f12fdf4 100644 --- a/apps/web-antd/src/api/core/index.ts +++ b/apps/web-antd/src/api/core/index.ts @@ -1,7 +1,6 @@ export * from './auth'; export * from './chatflow'; export * from './menu'; -export * from './repository'; export * from './server'; export * from './user'; export * from './workflow'; diff --git a/apps/web-antd/src/views/ppt/index.vue b/apps/web-antd/src/views/ppt/index.vue index db7d226..2120508 100644 --- a/apps/web-antd/src/views/ppt/index.vue +++ b/apps/web-antd/src/views/ppt/index.vue @@ -386,13 +386,13 @@ const getConversationList = async () => { }, { userId: '1563', - lastId: '4dfa17e1-364a-4c98-af5d-1109c8f28212', + lastId: '', sortBy: '', limit: '5', }, ); if (res.status === 200) { - conversationsItems.value = res.data.data.map((item: any) => { + conversationsItems.value = res.data.map((item: any) => { return { key: item.id, label: item.name, diff --git a/apps/web-antd/src/views/spider/index.vue b/apps/web-antd/src/views/spider/index.vue index ddbc61c..fb723e2 100644 --- a/apps/web-antd/src/views/spider/index.vue +++ b/apps/web-antd/src/views/spider/index.vue @@ -50,7 +50,7 @@ const getChatflowList = async () => { mode: '', name: '', }); - tools.value = res.data; + tools.value = res; } catch (error) { console.error(error); } @@ -76,9 +76,8 @@ const startFetching = async () => { inputs: {}, }, ); - // 保存抓取结果 - fetchResult.value = res.data.data.outputs.result; + fetchResult.value = res.data.outputs.result; } catch (error) { console.error(error); } diff --git a/apps/web-antd/vite.config.mts b/apps/web-antd/vite.config.mts index cc8e423..0f07d4f 100644 --- a/apps/web-antd/vite.config.mts +++ b/apps/web-antd/vite.config.mts @@ -13,18 +13,19 @@ export default defineConfig(async () => { target: 'http://localhost:8081/api', ws: true, }, - '/v1': { - target: 'http://localhost:8081/v1', - rewrite: (path) => path.replace(/^\/v1/, ''), - changeOrigin: true, - }, '/static': { - target: 'http://47.112.173.8:6802', changeOrigin: true, + rewrite: (path) => path.replace(/^\/static/, ''), + target: 'http://47.112.173.8:6802', }, '/static/*.docx': { - target: 'http://47.112.173.8:6805', changeOrigin: true, + target: 'http://47.112.173.8:6805', + }, + '/v1': { + changeOrigin: true, + rewrite: (path) => path.replace(/^\/v1/, ''), + target: 'http://localhost:8081/v1', }, }, }, diff --git a/packages/effects/request/src/request-client/request-client.ts b/packages/effects/request/src/request-client/request-client.ts index e581167..05b1666 100644 --- a/packages/effects/request/src/request-client/request-client.ts +++ b/packages/effects/request/src/request-client/request-client.ts @@ -60,7 +60,7 @@ class RequestClient { }, responseReturn: 'raw', // 默认超时时间 - timeout: 10_000, + timeout: 1_800_000, }; const { ...axiosConfig } = options; const requestConfig = merge(axiosConfig, defaultConfig);