vite代理 server:{ host:'localhost', port:'8081', proxy:{ '/api':{ target:'http://localhost:3000', //代理目标端口 changOrigin:true, //是否跨域 rewrite:(path) => path.replace(/^\/api/,'') //代理使用api,但是访问的后台接口不会增加/api这个路径(如果加上了,可能引起接口404) } } }