soso网站提交入口,国外优秀的字体设计网站,黄冈市建设局官方网站,公司文化墙设计方案服务器配置都是在开发情况下适用#xff01;#xff01;
// 服务器配置
server: {//允许IP访问host: 0.0.0.0,//应用端口#xff08;默认#xff1a;3000#xff09;port: Number(env.VITE_APP_PORT),// 运行是否自动打开浏览器open: true,// 代理配置proxy:…服务器配置都是在开发情况下适用
// 服务器配置
server: {//允许IP访问host: 0.0.0.0,//应用端口默认3000port: Number(env.VITE_APP_PORT),// 运行是否自动打开浏览器open: true,// 代理配置proxy: {// /dev-api[env.VITE_APP_BASE_API]: {changeOrigin: true,// 接口地址target: env.VITE_APP_API_URL,// http://localhost:8990rewrite: (path) path.replace(new RegExp(^ env.VITE_APP_BASE_API), ),//rewrite: (path) path.replace(/^\/dev-api/, )},},
},项目中请求接口为‘/api/queryData’, 后端服务为http://localhost:8990
①.不加rewrite: (path) path.replace(/^/dev-api/, ‘’) 后端接受到接口为http://localhost:8990/dev-api/queryData 额外多一个前缀’/dev-api’
②.加上rewrite: (path) path.replace(/^/dev-api/, ‘’) 后端接受到接口为http://localhost:8990/queryData 无前缀’/dev-api’
参考https://blog.csdn.net/lsk222/article/details/137279250