Template
34 lines
739 B
TypeScript
34 lines
739 B
TypeScript
import request from './request';
|
|
|
|
export interface ConfigResponse {
|
|
basePath: string;
|
|
inputDir: string;
|
|
libraryDir: string;
|
|
rejectedDir: string;
|
|
// 保留原有字段以保证向后兼容
|
|
aggregatedDir: string;
|
|
formatIssuesDir: string;
|
|
duplicatesDir: string;
|
|
zhOutputDir: string;
|
|
organizedDir: string;
|
|
libraryFinalDir: string;
|
|
}
|
|
|
|
export interface ConfigRequest {
|
|
basePath: string;
|
|
}
|
|
|
|
/**
|
|
* 保存基础路径配置
|
|
*/
|
|
export function saveBasePath(data: ConfigRequest): Promise<void> {
|
|
return request.post('/api/config/base-path', data);
|
|
}
|
|
|
|
/**
|
|
* 获取完整配置(包含所有派生路径)
|
|
*/
|
|
export function getConfig(): Promise<ConfigResponse | null> {
|
|
return request.get('/api/config/base-path');
|
|
}
|