+
+
From af9c67ec02a182608967c2c08db10a40459c7347 Mon Sep 17 00:00:00 2001
From: haozq <1611483981@qq.com>
Date: Thu, 29 Aug 2024 16:09:48 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E9=83=A8=E7=BD=B2=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.production | 5 +++--
src/components/Breadcrumb/index.vue | 2 +-
src/layout/components/Navbar.vue | 2 +-
src/permission.js | 2 +-
src/router/index.js | 1 +
src/utils/request.js | 2 +-
src/views/construction/manage/hoistManage/hoistManage.vue | 4 ++--
src/views/index.vue | 5 ++---
vue.config.js | 6 +++---
9 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/.env.production b/.env.production
index aa22a93..78968a8 100644
--- a/.env.production
+++ b/.env.production
@@ -1,8 +1,9 @@
# 页面标题
-VUE_APP_TITLE = 博诺思管理系统
+VUE_APP_TITLE = 庐江智慧工地
# 生产环境配置
ENV = 'production'
+BASE_URL=/zhgd-ht/
# 博诺思管理系统/生产环境
-VUE_APP_BASE_API = '/prod-api'
+VUE_APP_BASE_API = '/ljzhgd-api'
diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue
index 1696f54..5b59f83 100644
--- a/src/components/Breadcrumb/index.vue
+++ b/src/components/Breadcrumb/index.vue
@@ -35,7 +35,7 @@ export default {
const first = matched[0]
if (!this.isDashboard(first)) {
- matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched)
+ matched = [{ path: '/zhgd-ht/index', meta: { title: '首页' }}].concat(matched)
}
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 6ca10a7..3b7a717 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -102,7 +102,7 @@ export default {
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
- location.href = '/index';
+ location.href = '/zhgd-ht/';
})
}).catch(() => {});
}
diff --git a/src/permission.js b/src/permission.js
index c568979..4aaf40e 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -34,7 +34,7 @@ router.beforeEach((to, from, next) => {
}).catch(err => {
store.dispatch('LogOut').then(() => {
Message.error(err)
- next({ path: '/' })
+ next({ path: '/zhgd-ht' })
})
})
} else {
diff --git a/src/router/index.js b/src/router/index.js
index 71907b6..54f375a 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -177,6 +177,7 @@ Router.prototype.replace = function push(location) {
}
export default new Router({
+ base: process.env.BASE_URL, // 添加环境变量作为基础路径
mode: 'history', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
diff --git a/src/utils/request.js b/src/utils/request.js
index 2250d20..851149b 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -136,7 +136,7 @@ service.interceptors.response.use(res => {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
isRelogin.show = false;
store.dispatch('LogOut').then(() => {
- location.href = '/index';
+ location.href = '/zhgd-ht';
})
}).catch(() => {
isRelogin.show = false;
diff --git a/src/views/construction/manage/hoistManage/hoistManage.vue b/src/views/construction/manage/hoistManage/hoistManage.vue
index ab1407a..3b1e304 100644
--- a/src/views/construction/manage/hoistManage/hoistManage.vue
+++ b/src/views/construction/manage/hoistManage/hoistManage.vue
@@ -156,7 +156,7 @@ export default {
},
// 表单校验
rules: {},
- htmlContent: '/dz_video.html',
+ htmlContent: '/zhgd-ht/dz_video.html',
nocheckStyle: ['dev-info-box', 'layout', 'nocheck'],
checkStyle: ['dev-info-box', 'layout', 'check'],
warnStyle: ['dev-info-box', 'layout', 'warn'],
@@ -596,4 +596,4 @@ export default {
max-height: 70vh;
overflow-y: auto;
}
-
\ No newline at end of file
+
diff --git a/src/views/index.vue b/src/views/index.vue
index aadaf73..f29b8a1 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -36,7 +36,7 @@
Axios
Echarts
Quill
- ...
+
@@ -54,8 +54,7 @@
官网:http://www.ahbonus.cn
+ >http://www.ahbonus.cn
diff --git a/vue.config.js b/vue.config.js
index 40bbf21..067334d 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -18,9 +18,9 @@ module.exports = {
// 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.bonus.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.bonus.vip/admin/,则设置 baseUrl 为 /admin/。
- publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
+ publicPath: process.env.NODE_ENV === "production" ? "/zhgd-ht/" : "/zhgd-ht/",
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
- outputDir: 'dist',
+ outputDir: 'zhgd-ht',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: 'static',
// 是否开启eslint保存检测,有效值:ture | false | 'error'
@@ -35,7 +35,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
- target: `http://127.0.0.1:18080/ljzhgd/`,
+ target: `http://192.168.0.14:21900/ljzhgd/`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''