fix: API config

This commit is contained in:
tbphp committed 2025-07-02 18:09:06 +08:00
1 parent 9c597e6a74
commit c7d54db31a
2 files changed
+2 -3

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
import axios from "axios";
const http = axios.create({
baseURL: import.meta.env.VITE_API_BASE_URL,
baseURL: "/api",
timeout: 10000,
headers: { "Content-Type": "application/json" },
});
+1 -2
View File
@@ -17,9 +17,8 @@ export default defineConfig({
// 代理配置示例
proxy: {
"/api": {
target: "http://api.example.com",
target: "http://localhost:3000",
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ""),
},
},
},