安装中间件npm install http-proxy-middleware(可以配置多个代理)
//在src目录下新建setupProxy.js文件const proxy=require('http-proxy-middleware')module.exports=function(app){app.use(proxy.createProxyMiddleware('/api',{target:'https://meet.bjnsc.usingnet.com',secure:false,changeOrigin:true,pathRewrite:{"^/api":"/api"}}))}
使用
this.$axios.get("/api/auth/login").then(res => { console.log(res) })
