From e03be13c4a3f5f89487a01b47e0582f617325865 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Sat, 29 Mar 2025 10:27:11 +0800
Subject: [PATCH] fix: cesium 静态资源路径调整
---
src/router/page/index.js | 5 +++++
src/utils/cesium-tsa.js | 7 ++++++-
src/router/views/index.js | 6 +++---
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/router/page/index.js b/src/router/page/index.js
index be1abbb..b2706fc 100644
--- a/src/router/page/index.js
+++ b/src/router/page/index.js
@@ -64,4 +64,9 @@
isAuth: false,
},
},
+ {
+ path: '/',
+ name: '主页',
+ redirect: '/index',
+ },
];
diff --git a/src/router/views/index.js b/src/router/views/index.js
index 0b49d90..1a1126e 100644
--- a/src/router/views/index.js
+++ b/src/router/views/index.js
@@ -5,15 +5,15 @@
{
path: '/',
component: () => import('@/layout/index.vue'),
- redirect: '/home',
+ redirect: '/index',
children: [
{
- path: 'home',
+ path: 'index',
name: '首页',
meta: {
i18n: 'dashboard',
},
- component: () => import(/* webpackChunkName: "index" */ '@/views/Home/Home.vue'),
+ component: () => import(/* webpackChunkName: "home" */ '@/views/Home/Home.vue'),
},
{
path: 'taskManage',
diff --git a/src/utils/cesium-tsa.js b/src/utils/cesium-tsa.js
index 60cd4ba..cad09ed 100644
--- a/src/utils/cesium-tsa.js
+++ b/src/utils/cesium-tsa.js
@@ -3,7 +3,12 @@
import store from '@/store';
import { Terrain } from 'cesium';
-window.CESIUM_BASE_URL = '/cesiumPu';
+
+// vite env
+const { VITE_APP_BASE } = import.meta.env;
+
+
+window.CESIUM_BASE_URL = `${VITE_APP_BASE}cesiumPu`;
// 定义全局的viewer变量防止重复生成
let viewer = null;
let globalBaseMapLayers = [];
--
Gitblit v1.9.3