From 378920b7736c5c65f1c165abc2f38db36ecdc5cf Mon Sep 17 00:00:00 2001 From: kl <632104866@QQ.com> Date: Thu, 8 Mar 2018 14:28:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=A4=9A=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E8=BD=AE=E6=92=AD=E9=A2=84=E8=A7=88=E6=95=B0=E6=8D=AE=E9=87=8F?= =?UTF-8?q?=E5=A4=A7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/OnlinePreviewController.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/jodconverter-web/src/main/java/cn/keking/web/controller/OnlinePreviewController.java b/jodconverter-web/src/main/java/cn/keking/web/controller/OnlinePreviewController.java index a37d981c..5d8dbb95 100644 --- a/jodconverter-web/src/main/java/cn/keking/web/controller/OnlinePreviewController.java +++ b/jodconverter-web/src/main/java/cn/keking/web/controller/OnlinePreviewController.java @@ -73,7 +73,20 @@ public class OnlinePreviewController { return "picture"; } - + @RequestMapping(value = "picturesPreview", method = RequestMethod.POST) + public String picturesPreview(Model model, HttpServletRequest req) throws UnsupportedEncodingException { + String urls = req.getParameter("urls"); + String currentUrl = req.getParameter("currentUrl"); + // 路径转码 + String decodedUrl = URLDecoder.decode(urls, "utf-8"); + String decodedCurrentUrl = URLDecoder.decode(currentUrl, "utf-8"); + // 抽取文件并返回文件列表 + String[] imgs = decodedUrl.split("\\|"); + List imgurls = Arrays.asList(imgs); + model.addAttribute("imgurls", imgurls); + model.addAttribute("currentUrl",decodedCurrentUrl); + return "picture"; + } /** * 根据url获取文件内容 * 当pdfjs读取存在跨域问题的文件时将通过此接口读取