refactor: edit type
This commit is contained in:
parent
381f1c18e6
commit
d1133d0bc2
2 changed files with 15 additions and 6 deletions
|
|
@ -18,12 +18,19 @@ const useOcr = defineStore('useOcrStore', () => {
|
|||
},
|
||||
) {
|
||||
const res = await axios
|
||||
.post(`${baseUrl}/`, payload.file, {
|
||||
.post<{
|
||||
document: string;
|
||||
fields: { name: string; value: string }[];
|
||||
result: string;
|
||||
}>(`${baseUrl}/`, payload.file, {
|
||||
headers: { 'Content-Type': payload.file?.type },
|
||||
onUploadProgress: (e) => console.log(e),
|
||||
})
|
||||
.catch((e) => console.error(e));
|
||||
// ]);
|
||||
|
||||
if (!res || res.status >= 400) return false;
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue