采用spring-boot搭建项目,IDE采用Eclipse,数据库支持Mysql以及H2,集成了Mybatis、AngularJS、百度编辑器、文件上传、Redis、Solr、验证码以及微信等功能,前后台数据传输采用JSON方式,同时实现了登录拦截器以及跨域访问的配置。
spring-boot-project
spring-boot-common: 常用工具类 spring-boot-mapperpojo:从数据库导出的model以及mapper spring-boot-pagepojo:页面model spring-boot-service:服务层 spring-boot-web:页面,项目打包位置以及配置文件
1.用户管理:http://localhost:8002/admin/user/user.jsp
2.验证码:http://localhost:8002/
3.文件上传:http://localhost:8002/file.html
4.百度编辑器:http://localhost:8002/jslib/plugins/ueditor/index.html
5.api文档:http://localhost:8002/swagger-ui.html
在spring-boot-mapperpojo项目中,配置好src/main/resources/generator/generatorConfig.xml配置文件中的包名和路径,为了避免被重复覆盖,在mapper的java和xml文件导出路径中加了mappertemp目录,此目录仅作导出存储,需要手工复制一份到mapper路径。导出时采用mvn mybatis-generator:generate,如果是用maven build…菜单只要输入mybatis-generator:generate
在spring-boot-web项目中的com.kpttech.web包中的AdminInterceptor类。
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object obj) throws Exception { //这里验证用户是否登录 }完整的项目代码