Merge remote-tracking branch 'origin/shiy-login' into PingChuan

This commit is contained in:
PingChuan
2025-11-20 20:37:08 +08:00
25 changed files with 2299 additions and 762 deletions
+7 -7
View File
@@ -11,6 +11,7 @@ import { Button } from '~/components/ui/Button';
import { toastService } from '~/components/ui/Toast';
// import { DOCUMENT_URL } from "~/api/axios-client";
import { uploadContractTemplate } from '~/api/files/files-upload';
import axios from 'axios';
interface ReviewTabsProps {
activeTab: string;
@@ -65,14 +66,13 @@ export function ReviewTabs({ activeTab, onTabChange, children, fileInfo, onConfi
// 使用 PDF 代理路由获取文件,自动添加 JWT 认证
const downloadUrl = `/api/pdf-proxy?path=${encodeURIComponent(fileInfo.path || '')}`;
// 使用fetch获取文件内容
const response = await fetch(downloadUrl);
if (!response.ok) {
throw new Error(`下载失败: ${response.status} ${response.statusText}`);
}
// 使用axios获取文件内容
const response = await axios.get(downloadUrl, {
responseType: 'blob'
});
// 将响应转换为Blob
const blob = await response.blob();
// axios已经返回Blob
const blob = response.data;
// 创建Blob URL
const blobUrl = URL.createObjectURL(blob);