liyong
17 小时以前 1212e2b0dea3b44668c5293a3267a6fb780b420f
src/main/java/com/ruoyi/project/common/CommonController.java
@@ -1,5 +1,6 @@
package com.ruoyi.project.common;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
@@ -52,16 +53,15 @@
            {
                throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
            }
            String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
            String filePath = RuoYiConfig.getDownloadPath() + fileName;
            String realFileName =  fileName.substring(fileName.indexOf("_") + 1);
            response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
            FileUtils.setAttachmentResponseHeader(response, realFileName);
            FileUtils.writeBytes(filePath, response.getOutputStream());
            if (delete)
            {
                FileUtils.deleteFile(filePath);
            }
            FileUtils.writeBytes(fileName, response.getOutputStream());
//            if (delete)
//            {
//                FileUtils.deleteFile(fileName);
//            }
        }
        catch (Exception e)
        {