23 Star 299 Fork 147

leslie / RuoYi-Vue-Multi-Tenant

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

RuoYi-Vue-Multi-Tenant

star fork

github:https://github.com/leslie1015/RuoYi-Vue-Multi-Tenant
gitee: https://gitee.com/leslie8195/ruo-yi-vue-multi-tenant

PC端摸鱼背单词软件官网 | 直接下载

介绍

基于RuoYi-Vue扩展的多租户框架(SpringBoot,Spring Security,JWT,Vue & Element 的前后端分离权限管理系统)

环境准备

1.clone项目到本地

2.找到项目目录下脚本文件 /ruo-yi-vue-multi-tenant/ruoyi/multi_tenant.sql,导入到mysql

3.修改配置(未列出的配置请根据实际情况自行按需调整)

# datasource
spring.datasource.druid.master.url=jdbc:mysql://127.0.0.1:3306/mt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
spring.datasource.druid.master.username=root
spring.datasource.druid.master.password=123456
# redis
spring.redis.host=127.0.0.1
spring.redis.port=6379
#spring.redis.password=

如果使用阿里云OSS存储,可以修改以下配置,否则忽略或删除(删除时检查启动是否有影响)

# aliyun oss
aliyun.oss.endpoint = http://oss-cn-shanghai.aliyuncs.com
aliyun.oss.accessKeyId = xxxxxxxxxx
aliyun.oss.accessKeySecret = xxxxxxxxxx
aliyun.oss.defaultBucketName = xxxxxxxxxx
aliyun.oss.endpointContent = oss-cn-shanghai.aliyuncs.com

4.前端代码导入后,npm install / cnpm install 安装依赖,修改vue.config.js中devServer.proxy.target为后端地址

devServer: {
  host: '0.0.0.0',
  port: port,
  proxy: {
    [process.env.VUE_APP_BASE_API]: {
      target: `http://127.0.0.1:8080`,
      changeOrigin: true,
      pathRewrite: {
        ['^' + process.env.VUE_APP_BASE_API]: ''
      }
    }
  }

5.npm run dev启动前端

构建测试环境: npm run build:stage

构建生产环境:npm run build:prod

功能说明

-- 超级管理员,拥有系统最高权限
select * from sys_user where super_admin_flag = 1
-- 租户管理员
select * from sys_user where admin_flag = 1

-- 是否超级管理员菜单(0否1是),如创建菜单后,菜单栏不显示,注意检查此字段是否对应正确
select * from sys_menu where super_flag = 1

multi_tenant.sql脚本中初始化了超级管理员的账号密码

1.使用admin/admin123登录系统

2.打开 租户管理-权限模板-新增,添加一个权限模板,指定模板拥有的菜单权限

超级管理员-新增权限模板

3.打开 租户管理-租户列表-新增,新增一个租户,选择刚才的权限模板

超级管理员-创建租户

4.登出系统,使用刚才创建的租户账号重新登录系统,默认账号是上图中填写的手机号 13866688888,默认密码是123456.

# 默认的租户密码
sys.default.pwd=123456.
# 菜单下租户数据隔离,comId可以在上下文登陆用户信息中取到
 select * from order where com_id = #{comId}

登录后进入租户首页 租户管理员-首页 租户管理员可以创建角色,并且给角色分配该租户已有的权限,然后创建租户下的用户,并分配对应角色

其它

1.业务代码生成改为默认生成到business目录,与系统相关功能区分开

2.暂未支持岗位与部门,仅通过角色来控制权限

3.代码中有一些业务名词没有完全改过来,比如超管首页、租户/公司、首页的工单信息、icon等,时间原因,后续会逐步调整,当前如有需要请自行修改

4.感谢RuoYi ,Ruoyi项目地址 https://gitee.com/y_project/RuoYi-Vue

5.如有疑问,或者遇到bug,欢迎联系 邮箱:wangyy866@163.com QQ: 819543722

6.如果对您有用,感谢Star

MIT License Copyright (c) 2020 leslie 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.

简介

基于RuoYi-Vue扩展,支持多租户 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/leslie8195/ruo-yi-vue-multi-tenant.git
git@gitee.com:leslie8195/ruo-yi-vue-multi-tenant.git
leslie8195
ruo-yi-vue-multi-tenant
RuoYi-Vue-Multi-Tenant
master

搜索帮助