Skip to content

Commit

Permalink
Merge pull request #2792 from lhzzforever/dev/develop_ci
Browse files Browse the repository at this point in the history
fix:  兼容容器化部署外部环境非根路径的path
  • Loading branch information
ielgnaw authored Aug 29, 2024
2 parents 835d796 + 7be2464 commit c8b44da
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<link rel="icon" href="{{ STATIC_URL }}/images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" type="image/x-icon" />
<meta charset="utf-8">
<title>权限中心 | 蓝鲸智云</title>
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
5 changes: 3 additions & 2 deletions frontend/src/router/ce.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -210,9 +209,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: [
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/router/ee.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/

import il8n from '@/language';
import { rootPath } from '@blueking/sub-saas/dist/main.js';
import { getRoutePath } from '@/common/util';

// 系统接入
Expand Down Expand Up @@ -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: [
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/router/ieod.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/

import il8n from '@/language';
import { rootPath } from '@blueking/sub-saas/dist/main.js';
import { getRoutePath } from '@/common/util';

// 系统接入
Expand Down Expand Up @@ -208,10 +207,13 @@ const NotFound = () => import(/* webpackChunkName: 'none' */ '../views/404');
// Main
const MainEntry = () => import(/* webpackChunkName: 'index' */ '../views');

// 兼容容器化部署外部环境非根路径的path
const SITE_URL = getRoutePath(window.SITE_URL);

export const routes = [
{
// path: window.SITE_URL,
path: rootPath,
path: SITE_URL,
name: 'iamMain',
component: MainEntry,
children: [
Expand Down

0 comments on commit c8b44da

Please sign in to comment.