456
Jinquan_Ou
2023-04-15 2bcbf32c439a5d7fbb20234b86e410347d5b806f
zhang-content/src/main/java/com/ruoyi/service/impl/DownLoadFileServiceImpl.java
@@ -2,6 +2,7 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.service.DownLoadFileService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
@@ -14,9 +15,14 @@
 */
@Service
public class DownLoadFileServiceImpl implements DownLoadFileService {
    @Override
    public AjaxResult downLoadFile(String path, HttpServletResponse response) {
    @Value("${ruoyi.profile}")
    private String basePath;
    @Override
    public void downLoadFile(String path, HttpServletResponse response) {
        path=basePath+path.substring(8);
        File file = new File(path);
        byte[] buffer = new byte[1024];
        BufferedInputStream bis = null;
@@ -50,6 +56,5 @@
                e.printStackTrace();
            }
        }
        return AjaxResult.success("操作成功");
    }
}