feat: change api result
This commit is contained in:
parent
9692971a3c
commit
4af1861a9a
@ -5,6 +5,11 @@ export interface OCRReqVo {
|
||||
msg: string
|
||||
}
|
||||
|
||||
export interface OCRRespVo {
|
||||
markdown: string
|
||||
json: string
|
||||
}
|
||||
|
||||
/**
|
||||
* com.wmyun.module.system.controller.admin.forward.OCRController#OCRinterface
|
||||
* OCR识别
|
||||
@ -16,7 +21,7 @@ export function getOcrResult(data: OCRReqVo) {
|
||||
formData.append('file', data.file)
|
||||
|
||||
formData.append('mag', data.msg)
|
||||
return defHttp.post({ url: '/system/ocr/OCRinterface', data: formData, headers: {
|
||||
return defHttp.post<OCRRespVo>({ url: '/system/ocr/OCRinterface', data: formData, headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
} })
|
||||
}
|
||||
|
@ -19,10 +19,12 @@ onChange(async () => {
|
||||
loading.value = false
|
||||
if (files.value?.length && files.value?.length > 0) {
|
||||
loading.value = true
|
||||
ocrResult.value = await getOcrResult({
|
||||
|
||||
const result = await getOcrResult({
|
||||
file: files.value.item(0),
|
||||
msg: '识别图像内容,根据内容用makedown格式整理输出。',
|
||||
})
|
||||
ocrResult.value = result.markdown
|
||||
loading.value = false
|
||||
reset()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user