随笔 - 195  文章 - 0  评论 - 5  阅读 - 20万

RuoYi 集成H2数据库

参考:https://blog.csdn.net/huyuchengus/article/details/105323993

           https://blog.csdn.net/geejkse_seff/article/details/124423224?spm=1001.2014.3001.5502

1、依赖(Dependencies)

<dependency>
   <groupId>com.h2database</groupId>
   <artifactId>h2</artifactId>
   <version>2.1.210</version>
</dependency>

2、yml文件配置 spring下配置

#h2-console
  h2:
    console:
      path: /h2-console
      enabled: true
      settings:
        web-allow-others: true
        trace: false

3、拦截配置

filterChainDefinitionMap.put("/h2-console/**","anon");

4、SqlConsoleController

复制代码
@Controller
@RequestMapping("/pc/sql")
public class SqlConsoleController {

    @RequiresPermissions("tool:sql:list")
    @GetMapping("/index")
    public String index() {
        return "redirect:/h2-console";
    }
}
复制代码

5、添加菜单及权限

posted on   大山008  阅读(340)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示