- 依赖(Dependencies)
<dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>2.1.210</version> </dependency>
- yml文件配置 spring下配置
#h2-console h2: console: path: /h2-console enabled: true settings: web-allow-others: true trace: false
- 拦截配置
filterChainDefinitionMap.put("/h2-console/**","anon");
- H2ConsoleController
@Controller @RequestMapping("/h2/sql") public class H2ConsoleController { @RequiresPermissions("tool:sql:list") @GetMapping("/index") public String index() { return "redirect:/h2-console"; } }
- 添加菜单及权限