import { defineConfig } from "vite"; import uni from "@dcloudio/vite-plugin-uni"; // 注意此处,特别重要 export default defineConfig({ plugins: [uni()], server: { proxy: { "/api": { target: "http://banma8188.com/", changeOrigin: true, // rewrite 这个,需要根据具体项目进行判断是否需要 rewrite: (path) => path.replace(/^\/api/, ""), }, }, }, });