From 28ea77ec45bd860e23c0edfb6ee81a7d6599b25f Mon Sep 17 00:00:00 2001 From: web <candymxq888@outlook.com> Date: 星期六, 12 四月 2025 19:11:02 +0800 Subject: [PATCH] fix:修改配置文件 --- .env.development | 4 ++-- index.html | 2 +- .env.production | 4 ++-- vite.config.js | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.env.development b/.env.development index 69f13e0..354d39d 100644 --- a/.env.development +++ b/.env.development @@ -6,9 +6,9 @@ VITE_APP_ENV = 'development' # 图片地址 - VITE_APP_IMG_BASEURL='http://192.168.0.200:8036/upload' + VITE_APP_IMG_BASEURL='/api/upload' # 南京接口 # VITE_APP_PUBLIC_REQUEST_API = 'http://113.250.189.120:8038' #后端本地 - VITE_APP_PUBLIC_REQUEST_API = 'http://192.168.0.200:8038' + VITE_APP_PUBLIC_REQUEST_API = '/api' diff --git a/.env.production b/.env.production index 4c73bdd..b3e1770 100644 --- a/.env.production +++ b/.env.production @@ -6,9 +6,9 @@ VITE_APP_ENV = 'production' # 图片地址 - VITE_APP_IMG_BASEURL = 'http://113.250.189.120:8036/upload' + VITE_APP_IMG_BASEURL = '/api/upload' # 南京管理系统/开发环境 - VITE_APP_PUBLIC_REQUEST_API = 'http://127.0.0.1:8038' + VITE_APP_PUBLIC_REQUEST_API = '/api' # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip diff --git a/index.html b/index.html index d590719..c814f0d 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ <link rel="icon" href="/favicon.ico"> <title>南京康尼地铁泵站监测服务系统</title> <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> - <script type="text/javascript" src="./public/jessibuca.js"></script> + <script type="text/javascript" src="/jessibuca.js"></script> <style> html, diff --git a/vite.config.js b/vite.config.js index 5731f79..c55daa2 100644 --- a/vite.config.js +++ b/vite.config.js @@ -30,10 +30,10 @@ open: true, proxy: { // https://cn.vitejs.dev/config/#server-proxy - '/dev-api': { - target: 'http://localhost:8080', + '/api': { + target: 'http://192.168.0.200:8038', changeOrigin: true, - rewrite: (p) => p.replace(/^\/dev-api/, '') + rewrite: (p) => p.replace(/^\/api/, '') } } }, -- Gitblit v1.9.3