mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2025-07-17 01:46:29 +08:00
完善多图片轮播预览接口逻辑
This commit is contained in:
parent
e8f0efe1ec
commit
c78bf0605d
@ -61,13 +61,15 @@ public class OnlinePreviewController {
|
|||||||
* @throws UnsupportedEncodingException
|
* @throws UnsupportedEncodingException
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "picturesPreview", method = RequestMethod.GET)
|
@RequestMapping(value = "picturesPreview", method = RequestMethod.GET)
|
||||||
public String picturesPreview(String urls, Model model, HttpServletRequest req) throws UnsupportedEncodingException {
|
public String picturesPreview(String urls, String currentUrl, Model model, HttpServletRequest req) throws UnsupportedEncodingException {
|
||||||
// 路径转码
|
// 路径转码
|
||||||
String decodedUrl = URLDecoder.decode(urls, "utf-8");
|
String decodedUrl = URLDecoder.decode(urls, "utf-8");
|
||||||
|
String decodedCurrentUrl = URLDecoder.decode(currentUrl, "utf-8");
|
||||||
// 抽取文件并返回文件列表
|
// 抽取文件并返回文件列表
|
||||||
String[] imgs = decodedUrl.split("|");
|
String[] imgs = decodedUrl.split("\\|");
|
||||||
List imgurls = Arrays.asList(imgs);
|
List imgurls = Arrays.asList(imgs);
|
||||||
model.addAttribute("imgurls", imgurls);
|
model.addAttribute("imgurls", imgurls);
|
||||||
|
model.addAttribute("currentUrl",decodedCurrentUrl);
|
||||||
return "picture";
|
return "picture";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user