diff --git a/utils/service/index.js b/utils/service/index.js index ba7510c..d9b4560 100644 --- a/utils/service/index.js +++ b/utils/service/index.js @@ -1,7 +1,7 @@ import Request from "./request/index.js"; import useToast from "@/hooks/toast/useToast.js"; const { showMessage } = useToast(); - +console.log(1111,import.meta.env) const request = new Request({ baseURL: import.meta.env.VITE_API_URL, timeout: 1000 * 60 * 5, diff --git a/vite.config.js b/vite.config.js index 4c4bf27..71cca11 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,6 +4,11 @@ import uni from "@dcloudio/vite-plugin-uni"; export default defineConfig({ plugins: [uni()], server: { + // 选项写法 + '/': { + target: import.meta.env.VITE_API_URL, // 目标地址 + changeOrigin: true, + }, host: "0.0.0.0", // 这个用于启动 port: 8093, // 指定启动端口 open: true, //启动后是否自动打开浏览器