Files
ruoyi-vue/修复环境变量.txt
2025-11-05 13:27:52 +08:00

57 lines
1.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

请手动修改以下两个文件:
===========================================
文件1.env.development
===========================================
将以下内容:
VUE_APP_BASE_API = 'http://134.175.126.60:30313'
改为:
VUE_APP_BASE_API=/dev-api
完整文件内容应该是:
# 页面标题
VUE_APP_TITLE=Jarvis
# 开发环境配置
ENV=development
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES=true
# 开发环境使用代理路径通过vue.config.js的devServer代理到后端
VUE_APP_BASE_API=/dev-api
port=8888
===========================================
文件2.env.production
===========================================
将以下内容:
VUE_APP_BASE_API = '/jarvis-api'
改为:
VUE_APP_BASE_API=/dev-api
完整文件内容应该是:
# 页面标题
VUE_APP_TITLE=Jarvis
# 生产环境配置
ENV=production
# 生产环境使用相对路径通过nginx代理到后端
# 注意这里的路径必须与nginx配置中的 location /dev-api/ 保持一致
VUE_APP_BASE_API=/dev-api
port=8888
===========================================
重要提示:
===========================================
1. 注意等号两边不要有空格VUE_APP_BASE_API=/dev-api不是 VUE_APP_BASE_API = /dev-api
2. 不要使用引号(直接写 /dev-api不要写 '/dev-api' 或 "/dev-api"
3. 修改后必须重新打包npm run build:prod
4. 确保nginx配置中的 location /dev-api/ 与前端配置一致