admin-vben5/README.zh-CN.md

194 lines
7.3 KiB
Markdown
Raw Normal View History

2024-10-06 13:25:52 +08:00
[![license](https://img.shields.io/github/license/anncwb/vue-vben-admin.svg)](LICENSE)
2024-09-25 21:19:55 +08:00
2024-10-06 13:17:06 +08:00
## 提示
2024-09-25 21:19:55 +08:00
2024-10-06 13:25:52 +08:00
该仓库使用vben最新版本v5开发, 老版本v2地址 [前往](https://gitee.com/dapppp/ruoyi-plus-vben)
v5版本采用分仓(包)目录结构, 具体开发路径为: `根目录/apps/web-antd`
## 进度
**工作流相关模块等待后端重构后开发**
2024-10-08 13:38:33 +08:00
基础功能已经开发完毕
2024-09-26 09:35:24 +08:00
2024-10-08 13:47:25 +08:00
👉 [更新日志](https://gitee.com/dapppp/ruoyi-plus-vben5/blob/main/CHANGELOG.md)
2024-10-06 13:17:06 +08:00
## 简介
2024-09-25 21:19:55 +08:00
2024-10-06 17:00:16 +08:00
基于 [vben5 & ant-design-vue](https://github.com/vbenjs/vue-vben-admin) 的 RuoYi-Vue-Plus 前端项目
2024-09-04 17:40:23 +08:00
2024-10-06 13:25:52 +08:00
| 组件/框架 | 版本 |
| :------------- | :----- |
2024-10-19 10:21:06 +08:00
| vben | 5.4.1 |
2024-10-06 13:25:52 +08:00
| ant-design-vue | 4.2.5 |
| vue | 3.5.11 |
2024-09-04 17:40:23 +08:00
2024-10-06 13:17:06 +08:00
对应后端项目: **(分布式 5.X 分支 微服务 2.分支)**
2024-09-04 17:40:23 +08:00
2024-10-06 13:17:06 +08:00
分布式 [RuoYi-Vue-Plus](https://gitee.com/dromara/RuoYi-Vue-Plus/tree/5.X/)
2024-09-04 17:40:23 +08:00
2024-10-06 13:17:06 +08:00
微服务 [RuoYi-Cloud-Plus](https://gitee.com/dromara/RuoYi-Cloud-Plus/tree/2.X/)
2024-09-04 17:40:23 +08:00
2024-10-06 13:17:06 +08:00
## 预览
2024-09-04 17:40:23 +08:00
2024-10-06 13:17:06 +08:00
admin 账号: admin admin123
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
[预览地址点这里](http://vben5.dapdap.top)
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
## WX Group
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
暂不开放
2024-10-06 13:17:06 +08:00
## 文档
2024-05-19 21:20:42 +08:00
2024-10-09 17:51:39 +08:00
[本框架文档 强烈建议阅读](https://dapdap.top/)
2024-10-08 14:59:24 +08:00
[Vben V5 文档地址](https://doc.vben.pro/)
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
[RuoYi-Plus 文档地址](https://plus-doc.dromara.org/#/)
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
## 预览图
2024-07-28 17:16:50 +08:00
2024-10-06 13:25:52 +08:00
![图片](https://gitee.com/dapppp/ruoyi-plus-vben5/raw/main/scripts/preview/1.png) ![图片](https://gitee.com/dapppp/ruoyi-plus-vben5/raw/main/scripts/preview/2.png) ![图片](https://gitee.com/dapppp/ruoyi-plus-vben5/raw/main/scripts/preview/3.png) ![图片](https://gitee.com/dapppp/ruoyi-plus-vben5/raw/main/scripts/preview/4.png) ![图片](https://gitee.com/dapppp/ruoyi-plus-vben5/raw/main/scripts/preview/5.png) ![图片](https://gitee.com/dapppp/ruoyi-plus-vben5/raw/main/scripts/preview/6.png) ![图片](https://gitee.com/dapppp/ruoyi-plus-vben5/raw/main/scripts/preview/7.png) ![图片](https://gitee.com/dapppp/ruoyi-plus-vben5/raw/main/scripts/preview/8.png) ![图片](https://gitee.com/dapppp/ruoyi-plus-vben5/raw/main/scripts/preview/9.png) ![图片](https://gitee.com/dapppp/ruoyi-plus-vben5/raw/main/scripts/preview/10.png)
2024-07-28 17:16:50 +08:00
2024-10-06 13:17:06 +08:00
## 安装使用
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
前置准备环境(只能用pnpm)
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
```json
"packageManager": "pnpm",
"engines": {
2024-10-10 16:59:10 +08:00
"node": ">=20.15.0",
"pnpm": "latest"
2024-10-06 13:17:06 +08:00
},
```
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
- 获取项目代码
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
```bash
git clone https://gitee.com/dapppp/ruoyi-plus-vben5.git
```
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
- 安装依赖
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
```bash
cd ruoyi-plus-vben5
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
pnpm install
```
2024-05-19 21:20:42 +08:00
2024-10-08 14:35:00 +08:00
- 菜单图标替换
[根目录/scripts/菜单图标替换sql/update_icon.sql](https://gitee.com/dapppp/ruoyi-plus-vben5/blob/main/scripts/%E8%8F%9C%E5%8D%95%E5%9B%BE%E6%A0%87%E6%9B%BF%E6%8D%A2sql/update_icon.sql)
2024-10-06 13:25:52 +08:00
- 关于代码生成
2024-05-19 21:20:42 +08:00
2024-10-09 17:55:31 +08:00
V5版本代码生成模板为付费功能 [详见](https://dapdap.top/other/template.html)
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
- 关于一些监控的地址配置(微服务版本可以跳过这一小节)
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
使用[RuoYi-Vue-Plus](https://gitee.com/dromara/RuoYi-Vue-Plus/tree/5.X/)注意 `已经去除 admin/snailjob 的.env 配置` 可自行修改 有两种方式
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
1. 修改源码`/views/monitor/admin` `views/monitor/snailjob`
2024-05-19 21:20:42 +08:00
2024-10-07 20:12:56 +08:00
```html
<!-- 修改地址 -->
<template>
<iframe
class="size-full"
src="http://localhost:9090/admin/applications"
></iframe>
</template>
2024-05-19 21:20:42 +08:00
```
2024-10-06 13:17:06 +08:00
2. **推荐** 使用菜单自行配置 (跟 cloud 版本打开方式一致)
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
![图片](https://gitee.com/dapppp/ruoyi-plus-vben/raw/main/preview/菜单修改.png)
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
使用内嵌 iframe 方式需要解决跨域问题 可参考[nginx.conf](https://gitee.com/dromara/RuoYi-Vue-Plus/blob/5.X/script/docker/nginx/conf/nginx.conf#LC87)配置
2024-07-28 17:16:50 +08:00
2024-10-06 13:17:06 +08:00
- 修改.env.development 配置文件
- **注意 RSA 公私钥一定要修改和后端匹配**
- RSA 公私钥为两对 `前端请求加密-后端解密是一对` `后端响应加密 前端解密是一对`
```properties
# 端口号
VITE_PORT=5666
2024-10-07 20:12:56 +08:00
# 打包路径
2024-10-06 13:17:06 +08:00
VITE_BASE=/
# 是否开启 Nitro Mock服务true 为开启false 为关闭
VITE_NITRO_MOCK=false
# 是否打开 devtoolstrue 为打开false 为关闭
VITE_DEVTOOLS=false
# 是否注入全局loading
VITE_INJECT_APP_LOADING=true
# 后台请求路径 具体在vite.config.mts配置代理
VITE_GLOB_API_URL=/api
# 全局加密开关(即开启了加解密功能才会生效 不是全部接口加密 需要和后端对应)
VITE_GLOB_ENABLE_ENCRYPT=true
# RSA公钥 请求加密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对
VITE_GLOB_RSA_PUBLIC_KEY=
# RSA私钥 响应解密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对
VITE_GLOB_RSA_PRIVATE_KEY=
# 客户端id
VITE_GLOB_APP_CLIENT_ID=e5cd7e4891bf95d1d19206ce24a7b32e
# 开启WEBSOCKET
VITE_GLOB_WEBSOCKET_ENABLE=false
2024-05-19 21:20:42 +08:00
```
- 运行
```bash
2024-10-06 13:25:52 +08:00
pnpm dev:antd
2024-05-19 21:20:42 +08:00
```
- 打包
```bash
2024-10-06 13:25:52 +08:00
pnpm build:antd
2024-05-19 21:20:42 +08:00
```
2024-10-06 17:00:16 +08:00
## 这是一个特性 而不是一个bug!
1. 菜单管理可分配 但只有`admin`/`superadmin`角色能访问 其他角色访问会到403页面
2. 租户相关菜单可分配 但只有`superadmin`角色能访问 其他角色访问会到403页面
3. 分配的租户管理员无法修改自己的角色的菜单(即管理员角色的菜单) 防止自己把自己权限弄没了
2024-05-19 21:20:42 +08:00
## Git 贡献提交规范
- 参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
- `feat` 增加新功能
- `fix` 修复问题/BUG
- `style` 代码风格相关无影响运行结果的
- `perf` 优化/性能提升
- `refactor` 重构
- `revert` 撤销修改
- `test` 测试相关
- `docs` 文档/注释
- `chore` 依赖更新/脚手架配置修改等
2024-10-06 13:17:06 +08:00
- `workflow` 工作流改进
2024-05-19 21:20:42 +08:00
- `ci` 持续集成
- `types` 类型定义文件更改
- `wip` 开发中
## 浏览器支持
2024-10-06 13:17:06 +08:00
最低适配应该为`Chrome 88+`以上浏览器 详见 [css - where](https://developer.mozilla.org/en-US/docs/Web/CSS/:where#browser_compatibility)
本地开发推荐使用`Chrome` 最新版本浏览器
2024-05-19 21:20:42 +08:00
支持现代浏览器, 不支持 IE
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
| :-: | :-: | :-: | :-: | :-: |
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
## 捐赠
2024-10-06 13:17:06 +08:00
如果项目帮助到您 可以考虑请作者喝杯咖啡 万分感谢您对开源的支持!
2024-05-19 21:20:42 +08:00
2024-10-06 13:17:06 +08:00
<img src=https://plus.dapdap.top/minio-server/plus/2024/03/16/98a9d704eb0c4c04b721bf7799217571.jpg height=360px />