From 35d0df3e4479f4375b23acaa0cb262f2dd6f6e9e Mon Sep 17 00:00:00 2001 From: lijing Date: Fri, 9 Oct 2026 09:33:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A1=B6=E6=A0=8F=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E3=80=8C=E5=8F=91=E5=B1=95=E9=A6=96=E9=A1=B5=E3=80=8D=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E8=B7=B3=E8=BD=AC=E5=89=8D=E5=8F=B0=20front?= =?UTF-8?q?=20=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - layout.vue:顶栏加 icon-shouye 图标,按当前部署路径推导 /{ctx}/front/#/home (本地 dev 无 contextPath 时退化为 http://localhost:8081/) - .env.dev:注释里本地后端端口订正为 8107 - .gitignore:忽略 dist_old/ dist_old2/ 构建产物备份 --- .env.dev | 2 +- .gitignore | 4 ++++ src/components/layout.vue | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.env.dev b/.env.dev index 50e970f..7d7390d 100644 --- a/.env.dev +++ b/.env.dev @@ -5,7 +5,7 @@ # 规避后端 CAS 过滤器不回 CORS 头导致的跨域拦截;SSO/基础平台用真实环境 VITE_BASE_HOST=http://base.yunhaixingtong.com VITE_SSO_HOST=http://sso.yunhaixingtong.com -# 留空 → serviceHost 走同源相对 /api(经 vite 代理到本地后端 8105);填绝对地址会绕过代理直连该域 +# 留空 → serviceHost 走同源相对 /api(经 vite 代理到本地后端 8107);填绝对地址会绕过代理直连该域 VITE_SERVICE_HOST=http://base.yunhaixingtong.com/profession/ VITE_ZIYUANKU_HOST=https://base.bestsch.com/BschZyk VITE_ZHUANXIANG_HOST=https://base.bestsch.com/BschZncpd diff --git a/.gitignore b/.gitignore index 2e36ff0..52f7027 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,10 @@ yarn.lock # scratch .temp +# 构建产物备份目录(本地留存,不入库) +dist_old/ +dist_old2/ + # vite 构建时间戳临时文件 vite.config.ts.timestamp-*.mjs diff --git a/src/components/layout.vue b/src/components/layout.vue index 818e7b7..3cf94f1 100644 --- a/src/components/layout.vue +++ b/src/components/layout.vue @@ -166,6 +166,18 @@ function linkHomePage() { window.location.href = "/"; } } + +/* 发展首页地址:线上 front 与 console 同 contextPath 平级部署(/{ctx}/console/ → /{ctx}/front/); + 本地 dev(根路径无段)跳 front dev 服务 8081 */ +const frontHomeUrl = (() => { + const seg = window.location.pathname.split("/").filter(Boolean); + const base = seg.length >= 2 ? `${window.location.origin}/${seg[0]}/front/` : "http://localhost:8081/"; + return base + "#/home"; +})(); + +const gotoFrontHome = () => { + window.open(frontHomeUrl, "_blank"); +};