Giter Site home page Giter Site logo

gradle_web's Introduction

gradle_web

这是《Spring实战》第四版spring web的学习项目

部署

  • 克隆项目,用idea打开
  • 等待gradle下载依赖

技术

###SpringMVC ###Hibernate ###Spring Data JPA ###JWT ####缺点:不能jwt的token不能主动禁用 ####1. 创建jwt类

  • JWTConfigurer: 为了添加filter,它将被应用到security config中
  • JWTFilter: jwt转换为Authentication, 并且用SecurityContextHolder.getContext().setAuthentication
  • CORSFilter: 允许跨域,添加Access-Control系列HTTP头
  • TokenProvider: (是Component)提供token和authentication互相转换的方法,配置secret等参数

####2. 修改security config .csrf() .disable()

             .and()
             .apply(jwtConfigurer());

####3. 添加controller

  • JWTController(TokenProvider, AuthenticationManager在securityconfig配置passwordEncoder等): /api/auth POST,登录获取token
  • LoginVM: @RequestBody LoginVM 用户名、密码、记住我 ###external configuration 外部化配置 配置保存在 /src/main/resources/billy.properties 在component类中获取配置 BillyServiceImpl @Value 在configuration类中获取配置 MongoConfig, RabbitMQConfig ###spring AOP Encoreable 定义新功能接口, GdhAspect 定义切面

gradle_web's People

Contributors

linruot avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.