springboot构建web应用,整合spring security, mybatis generator,spring mvc,pagehelper,Jenkins,简单有模板可参考

今天给大家介绍我的一个仓库oceanframework,所有组件兼容版本号都预定义在根目录的pom文件里:

统一各组件兼容的版本,及特殊组件集成

  1. common-auth(认证,鉴权)
  2. common-cache(缓存,redis缓存工具)
  3. common-utils(基础组件工具,如controller响应封装,分页等)
  4. ocean-geo(地理位置计算,如两点间距离计算,坐标互转)
  5. ocean-security(以spring security的方式实现认证等,可参考)
  6. ocean-web(全局异常处理等)
  7. ocean-codegen(代码生成)

大家如果用的话可以参考island_common,选最新的分支,这个web项目使用了oceanframework这个基础组件

同时配套的还有对应的运维脚本仓库ceanframework_devops

有不足的地方欢迎大家pull request或者提issue

不好访问github的话,这个是gitee地址

以下是详细介绍:

common-auth

 

1. 模块简介(module introduce)

 

该模块使用了spring-security框架来实现登录,鉴权等。
this module use spring-security archive login, authentication and so on.

2. 具体实现类(concrete implementation class)

 

com.lkyl.oceanframework.common.auth.token.TokenService.java
com.lkyl.oceanframework.common.auth.filter.TokenCheckFilter.java
当然还有一些配置类,具体实现可看代码,变量名称以及类名称可以直观了解意图

2.1 TokenService.java

 

createJwtToken 用于业务代码判断完登录成功后,进行token的创建。storeUser 用来存储用存储userPricipal,
refreshToken 用来刷新token时间,时间可配置,removeToken 移除token
createJwtToken

你可能感兴趣的:(spring,spring,boot,spring,mybatis,后端,java)