feat(api): uploadDocumentToServer 增加 attribute_type 参数
This commit is contained in:
@@ -2,6 +2,7 @@ import { postgrestGet, type PostgrestParams } from '../postgrest-client';
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { UPLOAD_URL, API_BASE_URL } from '../../config/api-config';
|
import { UPLOAD_URL, API_BASE_URL } from '../../config/api-config';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import { CONTRACT_TYPES, DEFAULT_CONTRACT_TYPE, type ContractType } from '~/constants/contractTypes';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查文档名称是否重复
|
* 检查文档名称是否重复
|
||||||
@@ -382,7 +383,8 @@ export async function uploadDocumentToServer(
|
|||||||
documentId?: number | null,
|
documentId?: number | null,
|
||||||
isReupload: boolean = false,
|
isReupload: boolean = false,
|
||||||
jwtToken?: string,
|
jwtToken?: string,
|
||||||
attachments?: File[]
|
attachments?: File[],
|
||||||
|
attributeType?: string
|
||||||
): Promise<{data: FileUploadResponse; error?: never} | {data?: never; error: string; status?: number}> {
|
): Promise<{data: FileUploadResponse; error?: never} | {data?: never; error: string; status?: number}> {
|
||||||
try {
|
try {
|
||||||
// console.log('【调试】开始上传文档:', { fileName, fileSize: binaryData.byteLength });
|
// console.log('【调试】开始上传文档:', { fileName, fileSize: binaryData.byteLength });
|
||||||
@@ -403,7 +405,8 @@ export async function uploadDocumentToServer(
|
|||||||
remark: remark || null,
|
remark: remark || null,
|
||||||
is_test_document: isTestDocument,
|
is_test_document: isTestDocument,
|
||||||
document_id: documentId || null,
|
document_id: documentId || null,
|
||||||
is_reupload: isReupload
|
is_reupload: isReupload,
|
||||||
|
attribute_type: attributeType || null
|
||||||
};
|
};
|
||||||
|
|
||||||
// 添加JSON字符串到FormData
|
// 添加JSON字符串到FormData
|
||||||
|
|||||||
Reference in New Issue
Block a user