index.js配置
dev: {
env: require('./dev.env'),
port: 3000,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api': {
target: 'http://192.168.3.200:8888/',
changeOrigin: true,
autoOpenBrowser: true,
cssSourceMap: false,
pathRewrite: {
'^/api': '/'
}
}
},
下面是 页面请求
created: function () {
this.$http.get('kbar_channel/page')
.then((res) => {
debugger;
this.newsList = res.data
}, (err) => {
console.log(err)
})
},
我本地起的服务器 端口3000
想过要访问 http://192.168.3.200:8888/kbar_channel/page这个接口
配置如上 但是请求的还是localhost
这是为什么呢 求大神指点
按我这样配置一下