From 8d35c831677660ee7d7b5d19f327223d0890598e Mon Sep 17 00:00:00 2001 From: tianliyong Date: Tue, 13 Dec 2022 18:32:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96url=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=9B=BE=E7=89=87=E5=A4=84=E7=90=86=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/axzo/oss/service/impl/FileServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/oss-service/src/main/java/cn/axzo/oss/service/impl/FileServiceImpl.java b/oss-service/src/main/java/cn/axzo/oss/service/impl/FileServiceImpl.java index 2c0b356..fd21b9c 100644 --- a/oss-service/src/main/java/cn/axzo/oss/service/impl/FileServiceImpl.java +++ b/oss-service/src/main/java/cn/axzo/oss/service/impl/FileServiceImpl.java @@ -266,13 +266,14 @@ public class FileServiceImpl implements FileService { if (CollectionUtil.isNotEmpty(fileList)) { fileList.stream().forEach(file -> { FindFileUrlResponse response = new FindFileUrlResponse(); - response.setUrl(file.getFileUrl()); + String fileUrl = file.getFileUrl(); String fileKey = file.getFileUuid(); if (fileKeyStyleMap.containsKey(fileKey)) { - response.setFileKey(fileKeyStyleMap.get(fileKey)); - } else { - response.setFileKey(fileKey); + fileKey = fileKeyStyleMap.get(fileKey); + fileUrl += fileKey.substring(fileKey.indexOf("?")); } + response.setFileKey(fileKey); + response.setUrl(fileUrl); resList.add(response); }); }