hi-frontend/packages/ui/openapi2ts.config.ts
web@ppanel ae5e95477c ♻️ refactor: Refactor API endpoints to use dynamic API prefix from environment variables
- Updated all service files to replace hardcoded API paths with `${import.meta.env.VITE_API_PREFIX}` for better configurability.
- Ensured consistency across user, common, and gateway services by applying the new API prefix format.
- Removed unnecessary comments and maintained ESLint disable directives where applicable.
2025-12-11 03:58:26 +00:00

36 lines
967 B
TypeScript

const baseConfig = {
requestLibPath: "import request from '@workspace/ui/lib/request';",
serversPath: "./src/services",
apiPrefix: "import.meta.env.VITE_API_PREFIX",
};
const config = [
{
...baseConfig,
schemaPath:
"https://raw.githubusercontent.com/perfect-panel/ppanel-docs/refs/heads/main/public/swagger/common.json",
projectName: "common",
},
{
...baseConfig,
schemaPath:
"https://raw.githubusercontent.com/perfect-panel/ppanel-docs/refs/heads/main/public/swagger/user.json",
projectName: "user",
},
{
...baseConfig,
schemaPath:
"https://raw.githubusercontent.com/perfect-panel/ppanel-docs/refs/heads/main/public/swagger/admin.json",
projectName: "admin",
},
{
...baseConfig,
schemaPath:
"https://raw.githubusercontent.com/perfect-panel/ppanel-docs/refs/heads/main/public/swagger/gateway.json",
apiPrefix: "",
projectName: "gateway",
},
];
export default config;