| @@ -1,16 +1,6 @@ | |||
| <h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">XueYi-MultiSaas</h1> | |||
| <h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Digimeta-MultiSaas</h1> | |||
| <h4 align="center">基于 Vue3/TypeScript/Ant-Design UI 和 Spring Cloud & Alibaba/Mybatis-Plus 的多租户SaaS开发框架。</h4> | |||
| <p align="center"> | |||
| <a style="margin-right: 5px"> | |||
| <img src="https://img.shields.io/badge/XueYi--MultiSaas-v2.5.0-brightgreen" alt="xueYi-MultiSaas"> | |||
| </a> | |||
| <a style="margin-right: 5px"> | |||
| <img src="https://gitee.com/xueyitiantang/XueYi-MultiSaas/badge/star.svg?theme=dark" alt="xueYi-MultiSaas"> | |||
| </a> | |||
| <a style="margin-right: 5px"> | |||
| <img src="https://gitee.com/xueyitiantang/XueYi-MultiSaas/badge/fork.svg?theme=dark" alt="xueYi-MultiSaas"> | |||
| </a> | |||
| </p> | |||
| ## 简介 | |||
| 基于SpringBoot | Spring Cloud & Alibaba | Mybatis-Plus | Vue3 | vite2 | TypeScript | Ant-Design-Vue UI 的微服务多租户SaaS开发框架,为企业级多租户Saas及集团化应用提供快速开发解决方案。 | |||
| @@ -25,28 +15,6 @@ | |||
| - **组织管理优化**:更完善的组织架构操作与管理逻辑 | |||
| - **微聚合多前端**:公共抽离,降低系统重复冗余 | |||
| ## 交流 | |||
| - 请移步右上角 **一键三连** :kissing_heart: | |||
| - QQ群:[](https://jq.qq.com/?_wv=1027&k=zw11JJhj) | |||
| - 若发现bug,请提Issues。 | |||
| ## 预览 | |||
| - **普通账户** | |||
| > 企业账号:xueYi | |||
| 员工账号:admin | |||
| 密码:admin123 | |||
| - **租管账户** | |||
| > 企业账号:administrator | |||
| 员工账号:admin | |||
| 密码:admin123 | |||
| - **演示** | |||
| >[multi.xueyitt.cn](https://multi.xueyitt.cn) | |||
| - **文档** | |||
| >[doc.xueyitt.cn](https://doc.xueyitt.cn) | |||
| - **视频** | |||
| >[space.bilibili.com](https://space.bilibili.com/479745149) | |||
| ## 结构 | |||
| * 采用前后端分离的模式,微服务版本前端。 | |||
| @@ -93,35 +61,145 @@ com.xueyi | |||
| └── pom.xml // 公共依赖 | |||
| ~~~ | |||
| ## 架构 | |||
| <img src="https://images.gitee.com/uploads/images/2021/1108/172436_9deff9ff_7382127.png"/> | |||
| ## 演示 | |||
| <table> | |||
| <tr> | |||
| <td><img src="https://gitee.com/xueyitiantang/images/raw/master/1.png" alt=""/></td> | |||
| <td><img src="https://gitee.com/xueyitiantang/images/raw/master/2.png" alt=""/></td> | |||
| </tr> | |||
| <tr> | |||
| <td><img src="https://gitee.com/xueyitiantang/images/raw/master/3.png" alt=""/></td> | |||
| <td><img src="https://gitee.com/xueyitiantang/images/raw/master/4.png" alt=""/></td> | |||
| </tr> | |||
| <tr> | |||
| <td><img src="https://gitee.com/xueyitiantang/images/raw/master/5.png" alt=""/></td> | |||
| <td><img src="https://gitee.com/xueyitiantang/images/raw/master/6.png" alt=""/></td> | |||
| </tr> | |||
| <tr> | |||
| <td><img src="https://gitee.com/xueyitiantang/images/raw/master/7.png" alt=""/></td> | |||
| <td><img src="https://gitee.com/xueyitiantang/images/raw/master/8.png" alt=""/></td> | |||
| </tr> | |||
| <tr> | |||
| <td><img src="https://gitee.com/xueyitiantang/images/raw/master/9.png" alt=""/></td> | |||
| <td><img src="https://gitee.com/xueyitiantang/images/raw/master/10.png" alt=""/></td> | |||
| </tr> | |||
| </table> | |||
| ## 开源 | |||
| **源于开源,回归开源** | |||
| * 感谢Vben开源的[vue-vben-admin](https://github.com/vbenjs/vue-vben-admin) | |||
| * 感谢苞米豆开源的[mybatis-plus](https://github.com/baomidou/mybatis-plus) | |||
| * 感谢小锅盖开源的[dynamic](https://gitee.com/baomidou/dynamic-datasource-spring-boot-starter) | |||
| ## 使用 | |||
| ### 拉取源代码 | |||
| ```shell | |||
| git pull http://git.lecooai.com/develop/digimeta-MultiSaas.git | |||
| ``` | |||
| ### 编译源代码 | |||
| ```shell | |||
| //根模块上执行 | |||
| mvn package | |||
| ``` | |||
| ### Docker部署与运行 | |||
| #### 1. 检查docker-compose.yml配置,修改对应的信息,主要是数据库的密码设置 | |||
| ```shell | |||
| environment: | |||
| MYSQL_ROOT_PASSWORD: Digimeta@123 | |||
| ``` | |||
| #### 2. 进入./docker目录,修改nacos/conf/application.properties文件,修改对应nacos数据源: | |||
| ```shell | |||
| db.url.0=jdbc:mysql://172.17.0.1:3306/xy-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC | |||
| db.user=root | |||
| db.password=Digimeta@123 | |||
| ``` | |||
| #### 3. 运行base | |||
| ```shell | |||
| sh ./deploy.sh base | |||
| ``` | |||
| 确保mysql能远程访问,不然nacos启动会报错,以下可为远程访问mysql提供参考: | |||
| ```sql | |||
| #进入容器里执行,登录mysql | |||
| 查看:select host,user,plugin from user; | |||
| 删除多余的行:delete from user where user ='root' and host='%'; | |||
| 设置所有host可以访问:update user set host='%' where user ='root'; | |||
| 修改密码:ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Digimeta@123'; | |||
| 刷一下,使之生效:FLUSH PRIVILEGES; | |||
| 退出:exit | |||
| ``` | |||
| #### 4. 运行modules | |||
| ```shell | |||
| sh ./deploy.sh modules | |||
| ``` | |||
| #### 5. 运行monitor | |||
| ```shell | |||
| sh ./deploy.sh monitor | |||
| ``` | |||
| #### 6. 运行前端ui | |||
| 代码下执行`npm install` | |||
| 然后执行 | |||
| ```shell | |||
| npm run dev | |||
| ``` | |||
| 也可以编译后放在nginx中运行 | |||
| ```shell | |||
| npm run build:stage | |||
| 或生产模式编译 | |||
| npm run build:prod | |||
| ``` | |||
| nginx使用docker部署,nginx相关配置如下: | |||
| ```shell | |||
| server { | |||
| listen 81; | |||
| server_name localhost; | |||
| charset utf-8; | |||
| gzip on; | |||
| # 不压缩临界值,大于1K的才压缩,一般不用改 | |||
| gzip_min_length 1k; | |||
| # 压缩缓冲区 | |||
| gzip_buffers 16 64K; | |||
| # 压缩版本(默认1.1,前端如果是squid2.5请使用1.0) | |||
| gzip_http_version 1.1; | |||
| # 压缩级别,1-10,数字越大压缩的越好,时间也越长 | |||
| gzip_comp_level 5; | |||
| # 进行压缩的文件类型 | |||
| gzip_types text/plain application/x-javascript text/css application/xml application/javascript; | |||
| # 跟Squid等缓存服务有关,on的话会在Header里增加"Vary: Accept-Encoding" | |||
| gzip_vary on; | |||
| # IE6对Gzip不怎么友好,不给它Gzip了 | |||
| gzip_disable "MSIE [1-6]\."; | |||
| location / { | |||
| # 不缓存html,防止程序更新后缓存继续生效 | |||
| if ($request_filename ~* .*\.(?:htm|html)$) { | |||
| add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; | |||
| access_log on; | |||
| } | |||
| root /home/vctgo/projects/vctgo-ui/xueyi-ui; | |||
| try_files $uri $uri/ /index.html | |||
| index index.html index.htm; | |||
| } | |||
| location /dev-api/ { | |||
| proxy_set_header Host $host; | |||
| proxy_set_header X-Real-IP $remote_addr; | |||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |||
| proxy_pass http://172.17.0.1:8080/; | |||
| proxy_redirect default; | |||
| add_header Access-Control-Allow-Origin *; | |||
| add_header Access-Control-Allow-Headers X-Requested-With; | |||
| add_header Access-Control-Allow-Methods GET,POST,OPTIONS; | |||
| } | |||
| location /stage-api/ { | |||
| proxy_set_header Host $host; | |||
| proxy_set_header X-Real-IP $remote_addr; | |||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |||
| proxy_pass http://172.17.0.1:8080/; | |||
| proxy_redirect default; | |||
| add_header Access-Control-Allow-Origin *; | |||
| add_header Access-Control-Allow-Headers X-Requested-With; | |||
| add_header Access-Control-Allow-Methods GET,POST,OPTIONS; | |||
| } | |||
| location /prod-api/ { | |||
| proxy_set_header Host $host; | |||
| proxy_set_header X-Real-IP $remote_addr; | |||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |||
| proxy_pass http://172.17.0.1:8080/; | |||
| proxy_redirect default; | |||
| add_header Access-Control-Allow-Origin *; | |||
| add_header Access-Control-Allow-Headers X-Requested-With; | |||
| add_header Access-Control-Allow-Methods GET,POST,OPTIONS; | |||
| } | |||
| error_page 500 502 503 504 /50x.html; | |||
| location = /50x.html { | |||
| root html; | |||
| } | |||
| } | |||
| ``` | |||
| 81端口则为项目的web访问端口 | |||
| #### 7. 一些问题 | |||
| 1. 系统接口,流量监控,服务治理,服务监控等目录,需要在数据库中配置好相应的地址,不然页面访问不了; | |||
| 2. 其他一些问题可以去参考[xueyi](https://gitee.com/xueyitiantang/XueYi-MultiSaas)和[ruoyi](https://gitee.com/y_project/RuoYi-Cloud)框架,在这两个项目中的issue中可能可以获得相应帮助 | |||