19 lines
435 B
TypeScript
19 lines
435 B
TypeScript
import { requestClient } from '#/api/request';
|
|
|
|
/**
|
|
* 自动生成编码规则 API
|
|
*/
|
|
export function genCodeApi() {
|
|
async function getAutoCode(
|
|
ruleCode: string,
|
|
inputCharacter?: string,
|
|
): Promise<string> {
|
|
const url = inputCharacter
|
|
? `/infra/auto-code/get/${ruleCode}/${inputCharacter}`
|
|
: `/infra/auto-code/get/${ruleCode}`;
|
|
return requestClient.get<string>(url);
|
|
}
|
|
|
|
return { getAutoCode };
|
|
}
|