feat: 提交
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { request } from '@/utils/request'
|
||||
import { unwrapApiResponse } from '@/utils/api-response'
|
||||
import type { ApiResponseOf, SigningFieldDef } from '@/api/workbench/types'
|
||||
|
||||
export type SignaturePosition = NonNullable<SigningFieldDef['pdfPosition']>
|
||||
export interface SignaturePreview {
|
||||
pages: { page: number; width: number; height: number; image: string }[]
|
||||
candidates: (SignaturePosition & { id: string })[]
|
||||
}
|
||||
export async function getSignaturePreview(
|
||||
templateId: string,
|
||||
contentHtml: string,
|
||||
): Promise<SignaturePreview> {
|
||||
const response = await request.post<ApiResponseOf<SignaturePreview>>(
|
||||
`/v1/templates/${encodeURIComponent(templateId)}/signature-preview`,
|
||||
{ contentHtml },
|
||||
{ timeout: 60000 },
|
||||
)
|
||||
return unwrapApiResponse(response)
|
||||
}
|
||||
Reference in New Issue
Block a user