mirror of
				https://gitee.com/lab1024/smart-admin.git
				synced 2025-11-04 18:33:43 +08:00 
			
		
		
		
	解决前端文件下载报文件不存在的错误
This commit is contained in:
		@@ -270,7 +270,7 @@
 | 
			
		||||
  // 下载文件
 | 
			
		||||
  async function download(file) {
 | 
			
		||||
    try {
 | 
			
		||||
      await fileApi.downLoadFile(file.fileName, file.fileKey);
 | 
			
		||||
      await fileApi.downLoadFile(file.fileKey);
 | 
			
		||||
    } catch (e) {
 | 
			
		||||
      smartSentry.captureError(e);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ export const fileApi = {
 | 
			
		||||
  /**
 | 
			
		||||
   * 下载文件流(根据fileKey) @author 胡克
 | 
			
		||||
   */
 | 
			
		||||
  downLoadFile: (fileName, fileKey) => {
 | 
			
		||||
    return getDownload(fileName, '/support/file/downLoad', { fileKey });
 | 
			
		||||
  downLoadFile: (fileKey) => {
 | 
			
		||||
    return getDownload('/support/file/downLoad', { fileKey });
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -270,7 +270,7 @@ function view(file) {
 | 
			
		||||
// 下载文件
 | 
			
		||||
async function download(file) {
 | 
			
		||||
  try {
 | 
			
		||||
    await fileApi.downLoadFile(file.fileName, file.fileKey);
 | 
			
		||||
    await fileApi.downLoadFile(file.fileKey);
 | 
			
		||||
  } catch (e) {
 | 
			
		||||
    smartSentry.captureError(e);
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user