2026-03-12 13:05:20 +08:00
|
|
|
import { defineConfig } from 'orval';
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
readingPlatform: {
|
|
|
|
|
output: {
|
|
|
|
|
mode: 'split',
|
|
|
|
|
target: 'src/api/generated/index.ts',
|
|
|
|
|
schemas: 'src/api/generated/model',
|
|
|
|
|
client: 'axios',
|
|
|
|
|
override: {
|
|
|
|
|
mutator: {
|
|
|
|
|
path: 'src/api/generated/mutator.ts',
|
|
|
|
|
name: 'customMutator',
|
|
|
|
|
},
|
|
|
|
|
// 自定义类型名称
|
|
|
|
|
name: (type) => {
|
|
|
|
|
// 移除命名空间前缀,简化类型名称
|
|
|
|
|
return type.replace(/^(Result|ResultPageResult)/, '');
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// 导入优化
|
|
|
|
|
imports: {
|
|
|
|
|
axios: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
input: {
|
2026-03-13 13:48:28 +08:00
|
|
|
// 从 Java 后端 OpenAPI 文档生成
|
|
|
|
|
target: 'http://localhost:8080/v3/api-docs',
|
2026-03-12 13:05:20 +08:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|