Commit cba217cc2935785d41c117892b0c469ef7ae4945

Authored by YunaiV
1 parent d8726767

基于 /proxy-api 实现代理,简化 env.local 配置

yudao-ui-admin/.env.local
... ... @@ -5,7 +5,8 @@ ENV = 'development'
5 5 VUE_APP_TITLE = 芋道管理系统
6 6  
7 7 # 芋道管理系统/本地环境
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'
9 10  
10 11 # 路由懒加载
11 12 VUE_CLI_BABEL_TRANSPILE_MODULES = true
... ...
yudao-ui-admin/vue.config.js
... ... @@ -35,7 +35,7 @@ module.exports = {
35 35 open: true,
36 36 proxy: {
37 37 // detail: https://cli.vuejs.org/config/#devserver-proxy
38   - [process.env.VUE_APP_BASE_API]: {
  38 + ['/proxy-api']: {
39 39 target: `http://localhost:48080`,
40 40 // target: `http://api-dashboard.yudao.iocoder.cn`,
41 41 changeOrigin: true,
... ...