---优化上传组件删除多次上传数据不展示问题

This commit is contained in:
2025-12-05 16:40:17 +08:00
parent 7a8595bb4b
commit d4c07162d4
5 changed files with 95 additions and 42 deletions

View File

@ -2,6 +2,8 @@ import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
import { FilePageListParams, FilePageListSearchModel, FilePageListResultModel, ZipFilesModel, FileModel } from './model';
import { Base64 } from 'js-base64';
import { getAppEnvConfig } from '/@/utils/env';
import { useGlobSetting } from '/@/hooks/setting';
const globSetting = useGlobSetting();
@ -33,6 +35,12 @@ export function parseDownloadUrl(url:string,th?:boolean,full?:boolean) {
return resultUrl;
}
export function parsePreviewUrl(fileName: string, fileUrl: string) {
let fileFullUrl = fileUrl.includes('http://') || fileUrl.includes('https://') ? fileUrl : location.origin + getAppEnvConfig().VITE_GLOB_API_URL + fileUrl;
fileFullUrl+="&fullfilename="+fileName;
return getAppEnvConfig().VITE_GLOB_UPLOAD_PREVIEW + encodeURIComponent(Base64.encode(fileFullUrl));
}
export async function getInfoByDownloadUrl(params: {id: string}, mode: ErrorMessageMode = 'modal') {
return defHttp.get<FileModel>(
{
@ -132,3 +140,6 @@ export async function getAppToken(params, mode: ErrorMessageMode = 'modal') {
},
);
}