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 2022-07-20 11:29  大山008  阅读(381)  评论(0)    收藏  举报