1 Star 1 Fork 0

令狐冲 / ulyer-starter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

项目简介

内置代码生成器(orm jpa) 快速后台 可扩展,自定义权限策略,Token管理认证
DEMO

  • admin
  • 1234567

使用方式

git 克隆项目
配置本地maven
由于项目使用了queryDsl 需要先进行编译Q类
导入data文件夹下sql
修改相关数据库配置 环境 redis
启动

技术栈

模块 版本 备注
vue-element-admin 最新版
element-ui 2.15.6
spring boot 2.3.7.RELEASE
spring-security 2.3.7.RELEASE
spring-data-jpa 2.3.7.RELEASE
spring-data-redis 2.3.7.RELEASE
undertow-starter 2.3.7.RELEASE
vue 2.x
queryDsl 4.4.0
jwt 0.9.1 扩展token信息 ip

初始模块

  • 用户管理
  • 角色管理
  • 部门管理
  • 字典
  • 用户组
  • 日志
  • 资源
  • 代码生成

主要接口

// 验证当前请求是否具有权限访问
//默认实现 cn.ulyer.core.secure.authority.UrlAuthorityService
public interface AuthorityService {
    boolean hasAuthority(HttpServletRequest request, Authentication authentication) throws Exception;
}

//权限处理策略接口
public interface AuthorityHandlerStrategy {

    default boolean handler(HttpServletRequest request, Authentication authentication, GrantedAuthority grantedAuthority) throws Exception {
        return false;
    }

    String strategy();

}
默认实现
  • AuthenticatedHandlerStrategy AUTHENTICATED 已认证用户
  • DefaultHandlerStrategy ANY_ROLE 拥有给定任一权限
  • IpHandlerStrategy ANY_IP 符合给定任一IP(支持正则)
  • NoAuthHandlerStrategy NO_AUTH 直接通过
//tokenService   base-implements AbstractTokenService
public interface TokenService {

    Object store(Object token, Authentication authentication);

    Object generatorToken(HttpServletRequest request);

    Object readToken(HttpServletRequest request);

    Authentication authenticate(Object token) throws AuthenticationException;

    void remove(String token);
}

启用日志


@Import(LogAspect.class)
public class AppStater {
    public static void main(String[] args) {
        SpringApplication.run(AppStater.class, args);
    }
}
MIT License Copyright (c) 2021 令狐冲 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

快速java 脚手架 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/xiaoxiaofans/ulyer-starter.git
git@gitee.com:xiaoxiaofans/ulyer-starter.git
xiaoxiaofans
ulyer-starter
ulyer-starter
master

搜索帮助