使用对象存储时,文件管理的在线预览文件中的下载地址修正
This commit is contained in:
@@ -69,7 +69,7 @@ public class FileUploadController extends BaseController {
|
||||
@RequestMapping(value = "/download/{fileUploadId}")
|
||||
public String downloadFile(@PathVariable("fileUploadId") String fileUploadId, String preview, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
FileUpload fileUpload = fileUploadService.getFile(new FileUpload(fileUploadId));
|
||||
return fileUploadService.downloadFile(fileUpload, preview, request, response);
|
||||
return fileUploadService.downloadFile(fileUpload, preview, "file", request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,8 @@ public class UserfilesController extends BaseController {
|
||||
String uid = request.getParameter("uid");
|
||||
if (StringUtils.isNotBlank(url) && StringUtils.isNotBlank(uid)){
|
||||
fileUrl = url; //EncodeUtils.decodeUrl(url); 不用解码,否则腾讯云存储的时候预览不能显示
|
||||
fileUri = Global.getCtxPath() + Global.getAdminPath() + "/file/download/" + uid;
|
||||
String type = StringUtils.defaultIfBlank(request.getParameter("type"), "file");
|
||||
fileUri = Global.getCtxPath() + Global.getAdminPath() + "/" + type + "/download/" + uid;
|
||||
filePath = fileName;
|
||||
} else if (StringUtils.isNotBlank(fileName)){
|
||||
fileUri += "?fileName=" + EncodeUtils.encodeUrl(fileName);
|
||||
|
||||
Reference in New Issue
Block a user