优化文件上传逻辑,统一JWT令牌处理方式,简化请求头设置,提升代码可读性。

This commit is contained in:
2025-09-22 11:48:12 +08:00
parent aec2e1fca2
commit f2750773f9
3 changed files with 14 additions and 7 deletions
+2 -1
View File
@@ -512,13 +512,14 @@ export default function RulesFiles() {
try {
setAttachmentUploading(true);
const docId = parseInt(selectedDocumentId, 10);
const jwtToken = (frontendJWT as string | undefined) || (userInfo?.frontend_jwt as unknown as string | undefined);
const result = await appendContractAttachments(
docId,
attachmentFiles,
attachmentMergeMode,
true,
attachmentRemark || undefined,
frontendJWT as string | undefined
jwtToken
);
if (result.error) {
throw new Error(result.error);