【update】增加请求静态图片的配置

This commit is contained in:
fengchenchen
2022-11-14 15:44:44 +08:00
parent 262dbbdf92
commit 3f5bfef2b6
2 changed files with 23 additions and 0 deletions
+17
View File
@@ -48,3 +48,20 @@ yarn build
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
## 开发注意
需要单独启动nginx做本地文件的转发
####nginx中增加配置项
```
location /api/home/pic {
alias D:\\ProjectInformation\\library\\upload\\; #对应后台配置文件中的文件上传地址
}
```
#### vue.config.js -- proxy中增加配置项
```
// 请求静态图片配置项
'/api/home/pic': {
target: 'http://127.0.0.1:7061', // 图片请求的nginx网址
changeOrigin: true
}
```
+6
View File
@@ -14,7 +14,13 @@ module.exports = {
'/api': {
target: 'http://127.0.0.1:7060', // 服务器
changeOrigin: true,
},
// 请求静态图片配置项
'/api/home/pic': {
target: 'http://127.0.0.1:7061', // 图片请求的nginx网址
changeOrigin: true
}
}
},
chainWebpack: config => {