请求本地后台的一个地址http://localhost/spider/public/index.php/api/index3
提示跨域 我下面这样配置proxy后提示404 是我哪里写的不对吗?
config.js
proxyTable: {
'/api':{
target: "http://localhost/spider/public/index.php/api/",
changeOrigin:true,
pathRewrite:{
'^/api':''
}
}
},
main.js
Vue.prototype.HOME = '/api'
组件内
axios.get(this.HOME + '/index3?page=' + this.currentPage).then((response) => {
console.log(response)
})