From b08ed9b33a182afb919dc8b7f8f2bdfabce883d1 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Sun, 27 Apr 2025 17:02:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- .env.staging | 2 +- .gitignore | 2 +- build/index.js | 2 +- src/router/index.js | 2 +- src/views/login.vue | 2 +- vue.config.js | 6 +++--- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.env.development b/.env.development index f7770ca..5c4d9d5 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VUE_APP_TITLE = 人力发展集团管理系统 ENV = 'development' # 人力发展集团管理系统/开发环境 -VUE_APP_BASE_API = '/dev-api' +VUE_APP_BASE_API = 'http://192.168.1.144:8080/api' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/.env.production b/.env.production index df8b69e..db8ee1a 100644 --- a/.env.production +++ b/.env.production @@ -5,4 +5,4 @@ VUE_APP_TITLE = 人力发展集团管理系统 ENV = 'production' # 人力发展集团管理系统/生产环境 -VUE_APP_BASE_API = '/prod-api' +VUE_APP_BASE_API = 'http://192.168.1.144:8080/api' diff --git a/.env.staging b/.env.staging index b9b178c..475aebf 100644 --- a/.env.staging +++ b/.env.staging @@ -7,4 +7,4 @@ NODE_ENV = production ENV = 'staging' # 人力发展集团管理系统/测试环境 -VUE_APP_BASE_API = '/stage-api' +VUE_APP_BASE_API = 'http://192.168.1.144:8088/api' diff --git a/.gitignore b/.gitignore index 78a752d..d179158 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .DS_Store node_modules/ -dist/ +epmet-apartment-ui/ npm-debug.log* yarn-debug.log* yarn-error.log* diff --git a/build/index.js b/build/index.js index 0c57de2..d592273 100644 --- a/build/index.js +++ b/build/index.js @@ -18,7 +18,7 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) { app.use( publicPath, - serveStatic('./dist', { + serveStatic('./epmet-apartment-ui', { index: ['index.html', '/'] }) ) diff --git a/src/router/index.js b/src/router/index.js index 71907b6..e74e436 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -177,7 +177,7 @@ Router.prototype.replace = function push(location) { } export default new Router({ - mode: 'history', // 去掉url中的# + mode: 'hash', scrollBehavior: () => ({ y: 0 }), routes: constantRoutes }) diff --git a/src/views/login.vue b/src/views/login.vue index 4260b2f..5416b27 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -56,7 +56,7 @@ diff --git a/vue.config.js b/vue.config.js index 00f2b3d..149cd85 100644 --- a/vue.config.js +++ b/vue.config.js @@ -18,9 +18,9 @@ module.exports = { // 部署生产环境和开发环境下的URL。 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 - publicPath: process.env.NODE_ENV === "production" ? "/" : "/", + publicPath: process.env.NODE_ENV === "production" ? "/epmet-apartment-ui" : "/", // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) - outputDir: 'dist', + outputDir: 'epmet-apartment-ui', // 用于放置生成的静态资源 (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://localhost:8080`, + target: `http://192.168.1.144:8088`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''