feat: 顶栏新增「发展首页」入口,跳转前台 front 应用
build / build (push) Successful in 4m9s

- layout.vue:顶栏加 icon-shouye 图标,按当前部署路径推导 /{ctx}/front/#/home
  (本地 dev 无 contextPath 时退化为 http://localhost:8081/)
- .env.dev:注释里本地后端端口订正为 8107
- .gitignore:忽略 dist_old/ dist_old2/ 构建产物备份
This commit is contained in:
lijing
2026-10-09 09:33:15 +08:00
parent 8312d7a5f2
commit 35d0df3e44
3 changed files with 29 additions and 1 deletions
+1 -1
View File
@@ -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
+4
View File
@@ -28,6 +28,10 @@ yarn.lock
# scratch
.temp
# 构建产物备份目录(本地留存,不入库)
dist_old/
dist_old2/
# vite 构建时间戳临时文件
vite.config.ts.timestamp-*.mjs
+24
View File
@@ -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");
};
</script>
<template>
@@ -184,6 +196,9 @@ function linkHomePage() {
<a class="name fl align-middle text-ellipsis" href="javascript:void(0);" @click="linkUserInfo">
{{ userInfo.name }}
</a>
<a href="javascript:;" class="front-home fl align-middle" title="发展首页" @click="gotoFrontHome">
<i class="iconfont icon-shouye"></i>
</a>
<div class="delimiter fl align-middle"></div>
<a href="javascript:;" @click="logout" class="logout fl align-middle" title="退出登陆">
<i class="iconfont icon-logout"></i>
@@ -275,4 +290,13 @@ function linkHomePage() {
.left-menu a .iconfont {
margin-right: 8px;
}
/* 顶栏「发展首页」图标:对齐 .logout 的视觉规格(白 18px、padding 5px,hover 透明度由全局 a:hover 提供) */
.header-aside .front-home {
padding: 5px;
margin-right: 12px;
}
.header-aside .front-home i {
color: #fff;
font-size: 18px;
}
</style>