接口配置

This commit is contained in:
李志鹏
2026-05-21 10:48:53 +08:00
parent de6295f2af
commit 26dfbd9bb5
8 changed files with 162 additions and 151 deletions

View File

@@ -66,11 +66,10 @@ export default defineConfig(({ mode }) => {
overlay: true
},
proxy: {
'/api': {
//'/api'是自行设置的请求前缀
'/buyer': {
target: env.VITE_APP_URL,
changeOrigin: true, //用于控制请求头中的host值
rewrite: (path) => path.replace(/^\/api/, '/api') //路径重写正则匹配以api开头的路径为空将请求前缀删除
rewrite: (path) => path.replace(/^\/buyer/, '/buyer') //路径重写正则匹配以api开头的路径为空将请求前缀删除
}
}
}