diff --git a/backend/src/main/java/io/metersphere/config/ShiroConfig.java b/backend/src/main/java/io/metersphere/config/ShiroConfig.java index 88abf6d940..54505fc49b 100644 --- a/backend/src/main/java/io/metersphere/config/ShiroConfig.java +++ b/backend/src/main/java/io/metersphere/config/ShiroConfig.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.Objects; @Configuration -@ConditionalOnProperty(prefix="sso",name = "mode", havingValue = "local", matchIfMissing = true) +@ConditionalOnProperty(prefix = "sso", name = "mode", havingValue = "local", matchIfMissing = true) public class ShiroConfig implements EnvironmentAware { private Environment env; @@ -43,6 +43,8 @@ public class ShiroConfig implements EnvironmentAware { shiroFilterFactoryBean.getFilters().put("apikey", new ApiKeyFilter()); Map filterChainDefinitionMap = shiroFilterFactoryBean.getFilterChainDefinitionMap(); ShiroUtils.loadBaseFilterChain(filterChainDefinitionMap); + filterChainDefinitionMap.put("/display/info", "anon"); + filterChainDefinitionMap.put("/display/file/*", "anon"); filterChainDefinitionMap.put("/**", "apikey, authc"); return shiroFilterFactoryBean; } diff --git a/backend/src/main/java/io/metersphere/service/FileService.java b/backend/src/main/java/io/metersphere/service/FileService.java index a74fb7b243..e87980ed7d 100644 --- a/backend/src/main/java/io/metersphere/service/FileService.java +++ b/backend/src/main/java/io/metersphere/service/FileService.java @@ -14,6 +14,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; @@ -141,4 +142,12 @@ public class FileService { example.createCriteria().andIdIn(fileIds); return fileMetadataMapper.selectByExample(example); } + + public void deleteFileById(String fileId) { + deleteFileByIds(Collections.singletonList(fileId)); + } + + public FileMetadata getFileMetadataById(String fileId) { + return fileMetadataMapper.selectByPrimaryKey(fileId); + } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 597a1681d1..7238c00412 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 597a1681d1327a622b2a38bac3f17ae9daf95442 +Subproject commit 7238c00412997c529a2a28a47956977ebf83aa13 diff --git a/frontend/src/business/App.vue b/frontend/src/business/App.vue index c226861e51..ff55980514 100644 --- a/frontend/src/business/App.vue +++ b/frontend/src/business/App.vue @@ -7,7 +7,8 @@ -