权限管理系统之SpringBoot集成LayUI实现后台管理首页

万事开头难,昨天一直在构思用户权限管理系统怎么实现,实现哪些需求,采用什么技术等,也在网上百度了好多,计划使用SpringBoot + Mybatis + thymeleaf  + LayUI + Shiro等相关技术来实现,昨天新建了一个SpringBoot的项目,想着先使用LayUI实现左侧导航栏右侧上面Tab选项下面显示内容的系统首页,因为以前也没用过LayUI框架,昨天搞到2点多也没搞出来,今天偶然间找到了layTabPlus插件,该插件是一个layUI后台Tab布局框架的扩展插件,实现了Tab管理、刷新按钮、iframe优化等功能,很是好用,今天把layTabPlus插件集成到了SpringBoot项目中。html

1、下载插件git

须要下载两个插件,LayUI插件和layTabPlus插件,layTabPlus插件:https://gitee.com/Leytton/layTabPlus。web

2、新建SpringBoot项目spring

新建项目时选择Web和thymeleaf 模块,这样项目的pom.xml中会引入spring-boot-starter-thymeleaf来自动集成thymeleaf。浏览器

3、将LayUI、layTabPlus拷贝到项目中app

将在第一步下载的两个插件放到项目的资源包resources下,把layTabPlus插件中的index.html页面内容放到templates下,这里index.html用做了欢迎页面,因此使用了home.html。框架

4、建立Controlleride

这里在com.example.Controller包下建立了HomeController用来测试home.html。spring-boot

package com.example.Controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller @RequestMapping("/home") public class HomeController { @RequestMapping(value = "/home",method = RequestMethod.GET) public String hello(Model model) { return "home"; } }
View Code

这里还不能忘了在main类中加上一句扫描包,否则会报404错误。布局

@ComponentScan(basePackages = {"com.example.*"})

5、启动项目,浏览器输入http://localhost:8080/home/home

6、小结

目前把首页作出来了,后续就是在此基础上集成Mybatis、日志等模块,实现页面的增删改查功能。

 

原文出处:https://www.cnblogs.com/5ishare/p/10420026.html

相关文章
相关标签/搜索