3 Star 32 Fork 14

Will.F/Springboot-Multi-Tenant-SaToken

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

Multi-Tenant-SaToken

English

介绍

此项目 Multi-Tenant-SaToken 是基于RuoYi-Vue-Multi-Tenant 的升级版(SpringBoot,sa-token,mybatis-plus,Vue & Element),是一个简约、优雅、轻量级的多租户系统的脚手架。

github地址

升级和优化

  1. 重构权限认证模块,替换spring security,使用 sa-token 让鉴权更简单、优雅。
  2. Sa-Token整合jwt(Simple简单模式)
  3. springboot升级到2.6.8。
  4. 升级mybatis为mybatis-plus。
  5. 升级swagger,使用knife4j增强文档生成。
  6. 优化超级管理员和租户管理员的权限处理,统一交给sa-token,无需要手动if判断。
  7. 升级依赖包版本。
  8. 用户账号通过租户隔离,不同租户可以使用相同的账号。
  9. 支持从外部接入的token(如自家sso server创建的token)

环境和部署

前端(/ruoyi-ui)

本地启动:

yarn install
yarn dev

编译构建:

 测试环境:yarn build:stage
 生产环境:yarn build:prod
后端(/ruoyi)

数据库创建:

创建数据库:mtt
执行sql:/ruoyi/sql/multi_tenant.sql

Redis配置:

测试环境:application-dev.properties
# redis 配置
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.database=11
spring.redis.password=

Sa-Token Redis配置:

测试环境:application-dev.properties
# Sa-Token插件:配置Sa-Token单独使用的Redis database连接,权限缓存与业务缓存分离。
# Redis数据库索引
sa-token.alone-redis.database=10
# Redis服务器地址
sa-token.alone-redis.host: 127.0.0.1
# Redis服务器连接端口
sa-token.alone-redis.port: 6379
# Redis服务器连接密码(默认为空)
sa-token.alone-redis.password:

使用说明

前后端启动后,访问前端地址:http://localhost:1024/

使用系统管理员账号:admin/admin123, 登录租户管理系统后台(租户Code不填写),管理菜单和租户。

登录系统管理后台 img.png

添加菜单模版 img.png

添加租户 img.png

租户后台登录,http://localhost:1024/ img.png

感谢

  1. sa-token 轻量级 java 权限认证框架
  2. RuoYi-Vue-Multi-Tenant 基于RuoYi-Vue扩展的多租户框架
MIT License Copyright (c) 2023 Will.Feng 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.

简介

轻量级多租户后台管理系统的脚手架(SpringBoot,Sa-Token,mybatis-plus,Vue & Element)。 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/willf/springboot-multi-tenant-sa-token.git
git@gitee.com:willf/springboot-multi-tenant-sa-token.git
willf
springboot-multi-tenant-sa-token
Springboot-Multi-Tenant-SaToken
master

搜索帮助

Cb406eda 1850385 E526c682 1850385