server: { port:3333, proxy: { // 字符串简写写法 // '/foo': 'http://localhost:4567', // 选项写法 "/dev-api": { target: "http://localhost:8080", changeOrigin: true, rewrite: (path) => path.replace(/^\/dev-api/, '') }, // 正则表达式写法 // '^/fallback/.*': { // target: 'http://jsonplaceholder.typicode.com', // changeOrigin: true, // rewrite: (path) => path.replace(/^\/fallback/, '') // }, // 使用 proxy 实例 } }
前端跨域解决
最新推荐文章于 2024-09-12 16:43:23 发布