1.打开config/index.js,在proxyTable中添写如下代码
proxyTable: {
'/api': { //使用"/api"来代替"https://f.apiplus.c"
target: 'https://f.apiplus.cn', //源地址
secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true, //改变源 如果接口跨域,需要进行这个参数配置
pathRewrite: {
'^/api': ' ' //路径重写
}
}
}pr