diff --git a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java index 05b437a764..824180e3f3 100644 --- a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java +++ b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java @@ -42,6 +42,10 @@ public class ShiroServiceImpl implements ShiroService { filterChainDefinitionMap.put("/index.html", ANON); filterChainDefinitionMap.put("/link.html", ANON); + //获取主题信息 + filterChainDefinitionMap.put("/plugin/theme/themes", ANON); + filterChainDefinitionMap.put("/plugin/theme/items/**", ANON); + //验证链接 filterChainDefinitionMap.put("/api/link/validate**", ANON); filterChainDefinitionMap.put("/api/map/areaEntitys/**", ANON); diff --git a/backend/src/main/java/io/dataease/plugins/server/ThemeServer.java b/backend/src/main/java/io/dataease/plugins/server/ThemeServer.java new file mode 100644 index 0000000000..08e2d10374 --- /dev/null +++ b/backend/src/main/java/io/dataease/plugins/server/ThemeServer.java @@ -0,0 +1,50 @@ +package io.dataease.plugins.server; + +import java.util.List; + +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import io.dataease.plugins.config.SpringContextUtil; +import io.dataease.plugins.xpack.theme.dto.ThemeDto; +import io.dataease.plugins.xpack.theme.dto.ThemeItem; +import io.dataease.plugins.xpack.theme.dto.ThemeRequest; +import io.dataease.plugins.xpack.theme.service.ThemeXpackService; + +@RequestMapping("/plugin/theme") +@RestController +public class ThemeServer { + + + + @PostMapping("/themes") + public List themes(){ + + ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); + return themeXpackService.themes(); + } + + @PostMapping("/items/{themeId}") + public List themeItems(@PathVariable("themeId") int themeId) { + ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); + return themeXpackService.queryItems(themeId); + } + + @PostMapping("/save") + public void save(@RequestPart("request") ThemeRequest request, @RequestPart(value = "file", required = false) MultipartFile bodyFile) { + ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); + themeXpackService.save(request, bodyFile); + } + + @PostMapping("/delete/{themeId}") + public void save(@PathVariable("themeId") int themeId) { + ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); + themeXpackService.deleteTheme(themeId); + } + +} diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 66a91a15c0..27046fe564 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,14 +1,16 @@