配置如下:
import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [uni()],
server: {
proxy: {
host: "localhost",
port: "3000",
open: "true",
https: "true",
cors: "true",
"/api": {
target: "https://www.xxx.org",
changeOrigin: true,
secure: false,
},
},
},
});
4***@qq.com
我这运行到浏览器可以,但是运行到手机不行(手机上vite proxy会生效吗?)
2023-01-28 10:49
aelvetz (作者)
回复 4***@qq.com: 同一局域网下,防火墙关闭
2023-03-14 14:26