Commit 4e3de4d7 authored by liqin's avatar liqin 💬

bug fixed

parent 65fa8d2a
...@@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -105,8 +106,8 @@ public class AssetController extends BaseController { ...@@ -105,8 +106,8 @@ public class AssetController extends BaseController {
@PostMapping("/download") @PostMapping("/download")
@RequiresAuthentication @RequiresAuthentication
public void download(@RequestParam("idList") List<String> idList, HttpServletResponse response) throws IOException { public void download(@RequestParam("idList") List<String> idList, HttpServletResponse response) throws IOException {
response.setContentType("application/octet-stream"); response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
response.addHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode("video.zip", "UTF-8") + "\""); response.addHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + URLEncoder.encode("video.zip", "UTF-8"));
final Map<String, InputStream> map = new LinkedHashMap<>(idList.size() + 1); final Map<String, InputStream> map = new LinkedHashMap<>(idList.size() + 1);
final List<Asset> assetList = assetService.listByIds(idList); final List<Asset> assetList = assetService.listByIds(idList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment