【update】增加请求静态图片的配置
This commit is contained in:
@@ -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
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user