fix:sample/plate 之前的开发

This commit is contained in:
彭帅
2026-05-28 11:56:17 +08:00
parent fc36bc83e3
commit 8b65de36b8
367 changed files with 57752 additions and 947 deletions

View File

@@ -0,0 +1,37 @@
import { defineConfig } from "@hey-api/openapi-ts";
import { config } from "dotenv";
import { existsSync } from "node:fs";
import { resolve } from "node:path";
const envPath = resolve(process.cwd(), ".env");
if (existsSync(envPath)) {
config({ path: envPath });
}
const envLocalPath = resolve(process.cwd(), ".env.local");
if (existsSync(envLocalPath)) {
config({ path: envLocalPath });
}
const apiBaseUrl =
process.env.API_BASE_URL ||
process.env.NEXT_PUBLIC_API_BASE_URL ||
"http://localhost:8081";
const openApiUrl =
process.env.OPENAPI_URL ||
process.env.REACT_APP_OPENAPI_URL ||
`${apiBaseUrl.replace(/\/$/, "")}/brapi/v2/openapi.json`;
export default defineConfig({
client: "@hey-api/client-fetch",
input: openApiUrl,
output: "./src/lib/api",
schemas: {
name: "types.gen.ts"
},
services: {
name: "sdk.gen.ts"
},
clientName: "client.gen.ts"
});