-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
39 lines (39 loc) · 1.04 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module.exports = {
publicPath: './',
// 跨域代理
devServer: {
proxy: {
'/api': {
// target: 'http://star.ti01.cn/',
target: 'http://120.53.246.144:9091/',
ws: true, // 代理websockets
changeOrigin: true, // 虚拟的站点需要更管origin
pathRewrite: { // 重写路径 比如'/api/aaa/ccc'重写为'/aaa/ccc'
'^/api': ''
}
},
'/bingpic': {
target: 'https://qnets.cn/', // API服务器的地址
ws: true, // 代理websockets
changeOrigin: true, // 虚拟的站点需要更管origin
pathRewrite: { // 重写路径 比如'/api/aaa/ccc'重写为'/aaa/ccc'
'^/bingpic': '/bingpic'
},
headers: { // header设置
referer: 'https://qnets.cn/', // referer
origin: 'https://qnets.cn/'
}
}
}
},
configureWebpack: {
externals: {
'hls.js': 'hls.js',
vue: 'Vue',
axios: 'axios',
vuex: 'Vuex',
swiper: 'Swiper',
'element-ui': 'ELEMENT'
}
}
};