From b6390bfc0db0d5441c62eb13c0ced5fa4750686e Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Thu, 29 Aug 2024 11:47:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E5=8C=96=E9=83=A8=E7=BD=B2=E5=A4=96=E9=83=A8=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E9=9D=9E=E6=A0=B9=E8=B7=AF=E5=BE=84=E7=9A=84path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/index.html | 1 - frontend/src/common/util.js | 2 +- frontend/src/router/ce.js | 4 ++-- frontend/src/router/ee.js | 5 +++-- frontend/src/router/ieod.js | 7 ++++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index eea14bc38..a07356c3f 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -6,7 +6,6 @@ - 权限中心 | 蓝鲸智云
diff --git a/frontend/src/common/util.js b/frontend/src/common/util.js index 873fdf058..7c979018c 100644 --- a/frontend/src/common/util.js +++ b/frontend/src/common/util.js @@ -827,5 +827,5 @@ export function getCopyValue (value) { */ export const getRoutePath = (subPath) => { const path = subPath.startsWith('/') ? subPath.slice(1) : subPath; - return rootPath ? `${rootPath}${path}` : path; + return rootPath ? `${rootPath}${path}` : subPath; }; diff --git a/frontend/src/router/ce.js b/frontend/src/router/ce.js index 54413d7cd..f1c5a0dba 100644 --- a/frontend/src/router/ce.js +++ b/frontend/src/router/ce.js @@ -25,7 +25,6 @@ */ import il8n from '@/language'; -import { rootPath } from '@blueking/sub-saas/dist/main.js'; import { getRoutePath } from '@/common/util'; // const SITE_URL = window.SITE_URL; @@ -210,9 +209,10 @@ const NotFound = () => import(/* webpackChunkName: 'none' */ '../views/404'); // Main const MainEntry = () => import(/* webpackChunkName: 'index' */ '../views'); +const SITE_URL = getRoutePath(window.SITE_URL); export const routes = [ { - path: rootPath, + path: SITE_URL, name: 'iamMain', component: MainEntry, children: [ diff --git a/frontend/src/router/ee.js b/frontend/src/router/ee.js index 4b5c4a988..cf90171ee 100644 --- a/frontend/src/router/ee.js +++ b/frontend/src/router/ee.js @@ -25,7 +25,6 @@ */ import il8n from '@/language'; -import { rootPath } from '@blueking/sub-saas/dist/main.js'; import { getRoutePath } from '@/common/util'; // 系统接入 @@ -208,9 +207,11 @@ const NotFound = () => import(/* webpackChunkName: 'none' */ '../views/404'); // Main const MainEntry = () => import(/* webpackChunkName: 'index' */ '../views'); +const SITE_URL = getRoutePath(window.SITE_URL); + export const routes = [ { - path: rootPath, + path: SITE_URL, name: 'iamMain', component: MainEntry, children: [ diff --git a/frontend/src/router/ieod.js b/frontend/src/router/ieod.js index 6649378ef..cb6e09f1b 100644 --- a/frontend/src/router/ieod.js +++ b/frontend/src/router/ieod.js @@ -25,7 +25,6 @@ */ import il8n from '@/language'; -import { rootPath } from '@blueking/sub-saas/dist/main.js'; import { getRoutePath } from '@/common/util'; // 系统接入 @@ -207,11 +206,13 @@ const NotFound = () => import(/* webpackChunkName: 'none' */ '../views/404'); // Main const MainEntry = () => import(/* webpackChunkName: 'index' */ '../views'); - +// 兼容容器化部署外部环境非根路径的path +const SITE_URL = getRoutePath(window.SITE_URL); +console.log(SITE_URL); export const routes = [ { // path: window.SITE_URL, - path: rootPath, + path: SITE_URL, name: 'iamMain', component: MainEntry, children: [ From ed79229a72687543b5c25f9bae534fa31b9aea26 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Thu, 29 Aug 2024 11:52:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E9=9D=9E=E6=A0=B9?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E7=9A=84path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/router/ce.js | 1 + frontend/src/router/ieod.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/router/ce.js b/frontend/src/router/ce.js index f1c5a0dba..87118155f 100644 --- a/frontend/src/router/ce.js +++ b/frontend/src/router/ce.js @@ -210,6 +210,7 @@ const NotFound = () => import(/* webpackChunkName: 'none' */ '../views/404'); const MainEntry = () => import(/* webpackChunkName: 'index' */ '../views'); const SITE_URL = getRoutePath(window.SITE_URL); + export const routes = [ { path: SITE_URL, diff --git a/frontend/src/router/ieod.js b/frontend/src/router/ieod.js index cb6e09f1b..016bc69dc 100644 --- a/frontend/src/router/ieod.js +++ b/frontend/src/router/ieod.js @@ -206,9 +206,10 @@ const NotFound = () => import(/* webpackChunkName: 'none' */ '../views/404'); // Main const MainEntry = () => import(/* webpackChunkName: 'index' */ '../views'); + // 兼容容器化部署外部环境非根路径的path const SITE_URL = getRoutePath(window.SITE_URL); -console.log(SITE_URL); + export const routes = [ { // path: window.SITE_URL,