---优化文件预览功能

This commit is contained in:
2025-12-05 14:46:05 +08:00
parent 108957d99c
commit 7a8595bb4b

View File

@ -359,11 +359,11 @@
}; };
const handlePreview = async (file) => { const handlePreview = async (file) => {
const fileUrl = file.presignedUrl|| file.response?.data?.fileUrl || file.fileUrl; // const fileUrl = file.presignedUrl|| file.response?.data?.fileUrl || file.fileUrl;
console.log(fileUrl, 'fileUrl', file) // console.log(fileUrl, 'fileUrl', file)
window.open(fileUrl) // window.open(fileUrl)
const fileUrl = file.response?.data?.fileUrl || file.fileUrl; const fileUrl = file.presignedUrl|| file.response?.data?.fileUrl || file.fileUrl;
const fileName = file.response?.data?.fileOrg || file.fileOrg; const fileName = file.response?.data?.fileOrg || file.fileOrg;
let fileFullUrl = fileUrl.includes('http://') || fileUrl.includes('https://') ? fileUrl : location.origin + getAppEnvConfig().VITE_GLOB_API_URL + fileUrl; let fileFullUrl = fileUrl.includes('http://') || fileUrl.includes('https://') ? fileUrl : location.origin + getAppEnvConfig().VITE_GLOB_API_URL + fileUrl;
fileFullUrl+="&fullfilename="+fileName; fileFullUrl+="&fullfilename="+fileName;