1.找到index.js文件 2.在index.js中的dev{}中找到 在proxyTable{}中添加
'/api': {
target: 'http://xxxxxx.com', // 接口的域名
// secure: false, // 如果是https接口,需要配置這個參數
changeOrigin: true, // 如果接口跨域,需要進行這個參數配置
pathRewrite: {
'^/api': ''
}
}
如圖: