camera.api.ts 730 B

12345678910111213141516171819202122232425
  1. import HTTP from '@/request/alova';
  2. import { processMethod } from '@/request/api/flow.api';
  3. export function uploadFileMethod(file: File) {
  4. const formData = new FormData();
  5. formData.append('file', file);
  6. return HTTP.Post<{ name: string; url: string }>(`/file/upload`, formData, {});
  7. }
  8. export function saveFileMethod(params: Record<string, string>) {
  9. return HTTP.Get(`/fdhb-tablet/patientInfoManage/saveTonguefaceImg`, {
  10. params,
  11. async transform(data: string, headers) {
  12. const path = await processMethod(`/camera`);
  13. return {
  14. resultId: data,
  15. route: path ? { path } : {
  16. path: '/camera/result',
  17. query: { to: `/screen` },
  18. },
  19. };
  20. },
  21. });
  22. }