Coder Social home page Coder Social logo

springboot's Introduction

SpringBoot

此工程主要用于学习SpringBoot相关知识

目前新增了四个模块:

1、SpringSecurity: 用户和权限用数据库存储,而资源(url)和权限的对应采用硬编码配置。
2、SpringSecurity2: 用户、角色、权限和资源均采用数据库存储
3、SpringSecurity3:用户注册、邮箱验证
4、SpringSecurity4:注册登录合并

注:每个模块里面的README文件有对应模块的简要说明,时间关系,可能写的比较简陋一些,多担待,有问题请提issue

思考与总结:

1、将资源、角色、用户全部分开保存在数据库,再建立中间表进行管理处理,这样操作比较麻烦:
    **在使用前,需要先配置角色可以访问那些资源的中间表**,可以自己写代码处理,
    比较简单一点的方式就是:
    **只对用户进行角色的区分,具体哪一个角色具备哪些权限,由注解来决定:@PreAuthorize("hasRole('ROLE')"**)
    这样在Controller的路径下添加注解,就只需要管理用户和角色了,
    这样的缺陷是:
    如果资源对应的角色需要修改的时候需要重新修改代码;
    如果想直接根据用户的角色显示对应的内容,当然也可以处理,又要单独实现一圈,

springboot's People

Contributors

scnuwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

springboot's Issues

1、JPA多对多映射关系出现死循环导致内存泄露报错 答:找了大半天的问题,按照@ManyToMany源码示例配置仍然错误,最后去掉lombok的@Data注解解决问题,使用原始setter,getter。暂不知道原因???

1、JPA多对多映射关系出现死循环导致内存泄露报错
答:找了大半天的问题,按照@manytomany源码示例配置仍然错误,最后去掉lombok的@DaTa注解解决问题,使用原始setter,getter。暂不知道原因???

我之前遇到过,是因为toString方法互相引用,导致内存泄漏,手写toString方法,一方引用就行

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.