Merge remote-tracking branch 'origin/shiy-login' into PingChuan
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user