Jinquan_Ou
2023-03-19 651fa7b481a5688e8f0e88a6031b60194168436e
修改下载接口
3个文件已修改
14 ■■■■ 已修改文件
ruoyi-admin/src/main/resources/application-druid.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/DownLoadFileServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-druid.yml
@@ -8,8 +8,8 @@
            master:
                url: jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                username: root
                password: ZhangApp123!
#                password: 123456
#                password: ZhangApp123!
                password: 123456
            # 从库数据源
            slave:
                # 从数据源开关/默认关闭
ruoyi-admin/src/main/resources/application.yml
@@ -70,8 +70,8 @@
  # redis 配置
  redis:
    # 地址
    host: localhost
#    host: 192.168.88.68
#    host: localhost
    host: 192.168.88.68
    # 端口,默认为6379
    port: 6379
    # 数据库索引
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 {
    @Value("${ruoyi.profile}")
    private String basePath;
    @Override
    public AjaxResult downLoadFile(String path, HttpServletResponse response) {
        path=basePath+path.substring(8);
        File file = new File(path);
        byte[] buffer = new byte[1024];
        BufferedInputStream bis = null;