Skip to content

Commit c3f7dab

Browse files
committed
基于 /proxy-api 实现代理,简化 env.local 配置
1 parent c941376 commit c3f7dab

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.env.local

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ ENV = 'development'
55
VUE_APP_TITLE = 芋道管理系统
66

77
# 芋道管理系统/本地环境
8-
VUE_APP_BASE_API = '/dev-api'
8+
# VUE_APP_BASE_API = '/proxy-api'
9+
VUE_APP_BASE_API = 'http://127.0.0.1:48080'
910

1011
# 路由懒加载
1112
VUE_CLI_BABEL_TRANSPILE_MODULES = true

vue.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535
open: true,
3636
proxy: {
3737
// detail: https://cli.vuejs.org/config/#devserver-proxy
38-
[process.env.VUE_APP_BASE_API]: {
38+
['/proxy-api']: {
3939
target: `http://localhost:48080`,
4040
// target: `http://api-dashboard.yudao.iocoder.cn`,
4141
changeOrigin: true,

0 commit comments

Comments
 (0)