From 8d17c6eb9f2854670e706d49e0252d438ced51c1 Mon Sep 17 00:00:00 2001 From: vertoryao Date: Thu, 12 Jun 2025 16:16:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(@vben/web-antd):=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=8A=A8=E6=80=81=E5=8A=A0=E8=BD=BD=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20API=20=E5=9C=B0=E5=9D=80=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=88=AC=E8=99=AB=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改生产环境 API 地址为本地地址- 更新爬虫功能相关代码,增加 markdown-it 依赖 -调整 Vite 配置中的代理目标地址 - 优化工作流视图中的爬虫运行逻辑 --- apps/web-antd/.env.production | 3 ++- apps/web-antd/package.json | 1 + apps/web-antd/src/api/core/spider.ts | 4 ++-- apps/web-antd/src/views/dept/modules/auth-form.vue | 4 ++-- .../views/spider/components/workflow-work-view.vue | 14 +------------- apps/web-antd/src/views/spider/index.vue | 6 +----- apps/web-antd/src/views/spider/typing.ts | 2 +- apps/web-antd/src/views/word/index.vue | 1 + apps/web-antd/vite.config.mts | 11 ++++++----- pnpm-lock.yaml | 3 +++ 10 files changed, 20 insertions(+), 29 deletions(-) diff --git a/apps/web-antd/.env.production b/apps/web-antd/.env.production index a890ef2..c6b76b3 100644 --- a/apps/web-antd/.env.production +++ b/apps/web-antd/.env.production @@ -1,7 +1,8 @@ VITE_BASE=/ # 接口地址 -VITE_GLOB_API_URL=http://dify.vertoryao.xyz/api +# VITE_GLOB_API_URL=http://dify.vertoryao.xyz/api +VITE_GLOB_API_URL=http://172.16.35.190:9090/api # 是否开启压缩,可以设置为 none, brotli, gzip VITE_COMPRESS=none diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index 4208e6a..e74c3af 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -48,6 +48,7 @@ "ant-design-vue": "catalog:", "ant-design-x-vue": "^1.1.2", "dayjs": "catalog:", + "markdown-it": "^14.1.0", "pinia": "catalog:", "vue": "catalog:", "vue-router": "catalog:" diff --git a/apps/web-antd/src/api/core/spider.ts b/apps/web-antd/src/api/core/spider.ts index 84d2ffe..2dc2a3a 100644 --- a/apps/web-antd/src/api/core/spider.ts +++ b/apps/web-antd/src/api/core/spider.ts @@ -6,8 +6,8 @@ export function runSpider(data: any) { } // 广州公共资源爬虫 -export function runSpiderGz(data: any) { - return requestClient.post(`/spider2/run`, data); +export function runSpiderGz(appId: string, data: any) { + return requestClient.post(`/spider2/run/${appId}`, data); } export function getSpiderStatus() { diff --git a/apps/web-antd/src/views/dept/modules/auth-form.vue b/apps/web-antd/src/views/dept/modules/auth-form.vue index 0fea59f..8ff4185 100644 --- a/apps/web-antd/src/views/dept/modules/auth-form.vue +++ b/apps/web-antd/src/views/dept/modules/auth-form.vue @@ -8,7 +8,7 @@ import { useVbenVxeGrid } from '@vben/plugins/vxe-table'; import { getAllDeptTree } from '#/api'; -import { useAuthColumns } from '../data'; +// import { useAuthColumns } from '../data'; const emits = defineEmits(['success']); const formData = ref(); @@ -31,7 +31,7 @@ const [Modal, modalApi] = useVbenModal({ const [Grid, gridApi] = useVbenVxeGrid({ gridEvents: {}, gridOptions: { - columns: useAuthColumns(), + // columns: useAuthColumns(), height: 'auto', keepSource: true, pagerConfig: { diff --git a/apps/web-antd/src/views/spider/components/workflow-work-view.vue b/apps/web-antd/src/views/spider/components/workflow-work-view.vue index b7c4084..bc292dd 100644 --- a/apps/web-antd/src/views/spider/components/workflow-work-view.vue +++ b/apps/web-antd/src/views/spider/components/workflow-work-view.vue @@ -34,18 +34,6 @@ const props = withDefaults(defineProps(), { name: '', url: '', }), - runSpider: () => async () => ({ - msg: '', - code: '', - }), - getSpiderStatus: () => async () => ({ - msg: '', - code: '', - }), - stopSpider: () => async () => ({ - msg: '', - code: '', - }), runSpiderGz: () => async () => ({ outputs: { result: '', @@ -80,7 +68,7 @@ const startFetching = async () => { message: '正在获取中...', duration: 3, }); - const res = await props.runSpiderGz({ + const res = await props.runSpiderGz(props.item.id, { userId: userStore.userInfo?.userId || '', conversationId: '', files: [], diff --git a/apps/web-antd/src/views/spider/index.vue b/apps/web-antd/src/views/spider/index.vue index 34270bb..a93fcdb 100644 --- a/apps/web-antd/src/views/spider/index.vue +++ b/apps/web-antd/src/views/spider/index.vue @@ -90,22 +90,18 @@ onMounted(() => { /> diff --git a/apps/web-antd/src/views/spider/typing.ts b/apps/web-antd/src/views/spider/typing.ts index b806d67..2545949 100644 --- a/apps/web-antd/src/views/spider/typing.ts +++ b/apps/web-antd/src/views/spider/typing.ts @@ -57,7 +57,7 @@ interface Props { stopSpider?: () => Promise<{ status: string; }>; - runSpiderGz?: (data: SpiderContext) => Promise; + runSpiderGz?: (appId: string, data: SpiderContext) => Promise; } export type { diff --git a/apps/web-antd/src/views/word/index.vue b/apps/web-antd/src/views/word/index.vue index 70692f3..df0e142 100644 --- a/apps/web-antd/src/views/word/index.vue +++ b/apps/web-antd/src/views/word/index.vue @@ -43,6 +43,7 @@ const getLogs = async (appid: string) => { // page: 1, // }); hitsory.value = res.data; + loading.value = false; }; diff --git a/apps/web-antd/vite.config.mts b/apps/web-antd/vite.config.mts index f3ac521..e4ce0a8 100644 --- a/apps/web-antd/vite.config.mts +++ b/apps/web-antd/vite.config.mts @@ -10,8 +10,9 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ''), // mock代理目标地址 - // target: 'http://localhost:8081/api', - target: 'http://43.139.10.64:8082/api', + // target: 'http://172.16.35.190:9090/api', + // target: 'http://43.139.10.64:8082/api', + target: 'http://localhost:8081/api', // target: 'http://192.168.3.238:8081/api', ws: true, }, @@ -28,7 +29,7 @@ export default defineConfig(async () => { '/pptx': { changeOrigin: true, rewrite: (path) => path.replace(/^\/pptx/, ''), - target: 'http://47.112.173.8:6802/static', + target: 'http://47.112.173.8:6800/', }, '/spider': { changeOrigin: true, @@ -38,8 +39,8 @@ export default defineConfig(async () => { '/v1': { changeOrigin: true, rewrite: (path) => path.replace(/^\/v1/, ''), - // target: 'http://localhost:8081/v1', - target: 'http://43.139.10.64:8082/v1', + target: 'http://localhost:8081/v1', + // target: 'http://43.139.10.64:8082/v1', // target: 'http://192.168.3.238:8081/v1', }, }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 012725a..887ba89 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -661,6 +661,9 @@ importers: dayjs: specifier: 'catalog:' version: 1.11.13 + markdown-it: + specifier: ^14.1.0 + version: 14.1.0 pinia: specifier: ^3.0.2 version: 3.0.2(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3))