| 123456789101112131415161718192021222324252627282930313233343536373839 |
- import HTTP from '@/request/alova';
- import { processMethod2 } from '@/request/api/flow.api';
- import { useVisitor } from '@/stores';
- import { Dialog } from '@/platform';
- export function uploadFileMethod(file: File) {
- const formData = new FormData();
- formData.append('file', file);
- return HTTP.Post<{ name: string; url: string }>(`/file/upload`, formData, {});
- }
- export function saveFileMethod(params: Record<string, string>) {
- const Visitor = useVisitor();
- params.patientId = Visitor.patientId!;
- return HTTP.Get(`/fdhb-tablet/patientInfoManage/saveTonguefaceImg`, {
- params,
- async transform(data: string, headers) {
- Visitor.resultId = data;
- const flow = await processMethod2();
- let path = flow.optional
- ? await Dialog.show({
- title: flow.title || '获取健康调理方案',
- confirmButtonText: '好的',
- showCancelButton: true,
- cancelButtonText: '返回首页',
- width: 350,
- }).then(
- () => flow.route,
- () => '/screen'
- )
- : flow.route;
- return {
- resultId: data,
- route: { path },
- };
- },
- });
- }
|