-
chrome浏览器翻墙下载Allow-control-access-origin ,安装此插件,并打开
-
webpack.config.js 中配置
npm i http-proxy-middleware -D
头部引入: var webpack = require('webpack'); var path = require('path'); var proxy = require('http-proxy-middleware') 接口暴露: devServer:{ proxy:{ '/api':{ target:'http://api.douban.com', pathRewrite:{ '/api':'/' }, changeOrigin:true } } }