https://segmentfault.com/a/1190000011007043
// config.jsmodule.exports = {// ...dev: { proxyTable: {// 将所有以 /api 开头的请求通过 jsonplaceholder 代理'/api': { target:'http://jsonplaceholder.typicode.com', changeOrigin:true, pathRewrite: {'^/api':''} } } }}
https://segmentfault.com/a/1190000011007043
// config.jsmodule.exports = {// ...dev: { proxyTable: {// 将所有以 /api 开头的请求通过 jsonplaceholder 代理'/api': { target:'http://jsonplaceholder.typicode.com', changeOrigin:true, pathRewrite: {'^/api':''} } } }}
本文标题:vue-cli本地环境API代理设置和解决跨域
本文链接:https://www.haomeiwen.com/subject/kqauextx.html
网友评论