From ac36b31a325bf555365c65a15fcac08a12f5e626 Mon Sep 17 00:00:00 2001 From: chenxing Date: Thu, 17 Sep 2026 01:47:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(api):=20=E4=B8=A4=E5=A4=84=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=9B=BE=E5=9C=B0=E5=9D=80=E8=A1=A5=20serviceHost=20?= =?UTF-8?q?=E5=89=8D=E7=BC=80=EF=BC=88=E5=AD=90=E8=B7=AF=E5=BE=84=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E8=A3=B8=20/api=20404=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/module/svc.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/module/svc.ts b/src/api/module/svc.ts index d21d5bd..b561cac 100644 --- a/src/api/module/svc.ts +++ b/src/api/module/svc.ts @@ -1,5 +1,6 @@ import { Method } from "alova"; import { alovaInstance } from "@/utils/alova/alova-iview"; +import config from "@/assets/config/host.config"; import type { ApplyVo, FlowProgressVo, @@ -139,9 +140,10 @@ class SvcFlowApi { list(siteCode: string) { return get(`${SVC}/flow/list`, { siteCode }); } - /** 流程图地址(同源 /window.open;后端换免签 token 取图,前端不碰 flow-center 地址) */ + /** 流程图地址(同源 /window.open;后端换免签 token 取图,前端不碰 flow-center 地址)。 + * img/window.open 不走 alova,须显式带 serviceHost——/{ctx}/front/ 子路径部署下裸 /api 404。 */ diagramUrl(siteCode: string, flowGuid: string, mode = "dept") { - return `${SVC}/flow/diagram.png?siteCode=${encodeURIComponent(siteCode)}` + return `${config.serviceHost}${SVC}/flow/diagram.png?siteCode=${encodeURIComponent(siteCode)}` + `&flowGuid=${encodeURIComponent(flowGuid)}&mode=${encodeURIComponent(mode)}`; } } @@ -159,9 +161,9 @@ class ApplyApi { progress(id: number) { return get(`${APPLY}/${id}/progress`); } - /** 流程图地址(同源图片;后端换免签 token 取图) */ + /** 流程图地址(同源图片;后端换免签 token 取图;serviceHost 前缀原因同上) */ diagramUrl(id: number, mode = "dept") { - return `${APPLY}/${id}/diagram.png?mode=${encodeURIComponent(mode)}`; + return `${config.serviceHost}${APPLY}/${id}/diagram.png?mode=${encodeURIComponent(mode)}`; } }