README.md 6.5 KB
Newer Older
1
<p align="center">
2 3
    <img src="https://img.shields.io/badge/Vue-3.3.1-brightgreen.svg"/>
    <img src="https://img.shields.io/badge/Vite-4.3.5-green.svg"/>
4
    <img src="https://img.shields.io/badge/Element Plus-2.3.6-blue.svg"/>
5
    <img src="https://img.shields.io/badge/license-MIT-green.svg"/>
6 7 8 9 10
    <a href="https://gitee.com/youlaiorg" target="_blank">
        <img src="https://img.shields.io/badge/Author-有来开源组织-orange.svg"/>
    </a>
</p>
<p align="center">
11
 <a target="_blank" href="https://juejin.cn/post/7228990409909108793">vue3-element-admin官方文档</a> |  <a target="_blank" href="http://vue3.youlai.tech">在线预览</a> 
12
</p>
13

14

15
## 项目介绍
16

H
haoxr 已提交
17
[vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin) 是基于 Vue3 + Vite4+ TypeScript5 + Element-Plus + Pinia 等最新主流技术栈构建的后台管理前端模板(配套后端源码)。
18

H
haoxr 已提交
19
项目有以下特性:
20

H
haoxr 已提交
21 22 23 24
- 基于 vue-element-admin 升级到 vue3 版本,无自定义封装,易上手,减少学习成本。
- 提供了配套的 Java 后端接口,真实的接口数据,而非使用 Mock 数据。您可以访问在[线接口文档](https://www.apifox.cn/apidoc/shared-195e783f-4d85-4235-a038-eec696de4ea5)查看接口详情。
- 权限系统功能齐全,包括用户管理、角色管理、菜单管理、字典管理和部门管理等,以满足您对权限管理的需求。
- 项目还提供了基础设施支持,包括动态路由、按钮级别的权限控制、国际化支持、代码规范、Git 提交规范以及常用组件的封装,以便开发人员更高效地开发和维护项目。
25 26
## 项目预览

H
haoxr 已提交
27
- **在线预览**[https://vue3.youlai.tech/](https://vue3.youlai.tech/)
28

29
- **控制台**
H
haoxr 已提交
30 31

	![暗黑模式](https://s2.loli.net/2023/03/13/QvjY4zf3VCGteNF.png)
32

33
- **接口文档**
H
haoxr 已提交
34 35

	![接口文档](https://s2.loli.net/2023/03/13/bH4J3O6WRgCUpwt.png) 
H
haoxr 已提交
36 37


38
- **权限管理系统**
H
haoxr 已提交
39

H
haoxr 已提交
40 41 42
	| ![用户管理](https://s2.loli.net/2023/03/13/L9xgT5sSMVZukQj.png) | ![image-20230313003008012](https://s2.loli.net/2023/03/13/nQg6HmrtFUkPDYv.png) |
	| --- | --- |
	| ![image-20230313003028425](https://s2.loli.net/2023/03/13/C4fDRJeTuUO7gPI.png) | ![字典管理](https://s2.loli.net/2023/03/13/BzqjHpa64wfeWhE.png) |
43

44 45
## 项目地址

46 47 48
| 项目 | Gitee | Github |GitCode |
| --- | --- | --- | --- |
| 前端 | [vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin) | [vue3-element-admin](https://github.com/youlaitech/vue3-element-admin) |[vue3-element-admin](https://gitcode.net/youlai/vue3-element-admin)|
49
| 后端 | [youlai-boot](https://gitee.com/youlaiorg/youlai-boot) | [youlai-boot](https://github.com/haoxianrui/youlai-boot.git) |[youlai-boot](https://gitcode.net/youlai/youlai-boot)|
50

51
## 环境准备
52

53 54 55 56 57
|     环境     | 名称版本    | 备注            |
| ----------- | :-------- | --------------|
| **开发工具**         | VSCode       | [下载地址](https://code.visualstudio.com/Download)                                                            |
| **运行环境**         | Node 16+                 |  [下载地址](http://nodejs.cn/download)   |
| **VSCode插件(必装)** | 1. `Vue Language Features (Volar) ` <br/> 2. `TypeScript Vue Plugin (Volar) `  <br/>3. 禁用 Vetur | ![image-20230224222541797](https://s2.loli.net/2023/02/24/Qt4XDGHFOWqfsyB.png) |
58 59


H
haoxr 已提交
60
## 项目启动
61

H
haoxr 已提交
62
```bash
63 64 65
# 克隆代码
git clone https://gitee.com/youlaiorg/vue3-element-admin.git

H
haoxr 已提交
66 67
# 安装 pnpm
npm install pnpm -g
H
haoxr 已提交
68

H
haoxr 已提交
69 70
# 安装依赖
pnpm install
71

72
# 启动运行
H
haoxr 已提交
73
pnpm run dev
74 75 76
```

## 项目部署
77

78
```bash
郝先瑞 已提交
79 80
# 项目打包
pnpm run build:prod
81

82 83
# 上传文件至远程服务器
将打包生成在 `dist` 目录下的文件拷贝至 `/usr/share/nginx/html` 目录
84

85 86 87 88 89 90 91 92 93 94 95 96 97
# nginx.cofig 配置
server {
	listen     80;
	server_name  localhost;
	location / {
			root /usr/share/nginx/html;
			index index.html index.htm;
	}
	# 反向代理配置
	location /prod-api/ {
			proxy_pass http://vapi.youlai.tech/; # vapi.youlai.tech替换成你的后端API地址
	}
}
98 99 100 101 102 103 104 105
```



## 注意事项

- **自动导入插件自动生成默认关闭**

H
haoxr 已提交
106
  模板项目的组件类型声明已自动生成。如果添加和使用新的组件,请按照以下图示方法开启自动生成。在自动生成完成后,记得将其设置为 `false`,避免重复执行引发冲突。
107

108 109 110 111 112 113
  ![](https://s2.loli.net/2023/06/03/lrcsHzInYV6wWqo.png)

- **项目启动浏览器访问空白**

  请升级浏览器尝试,低版本浏览器内核可能不支持某些新的 JavaScript 语法,比如可选链操作符 `?.`

H
haoxr 已提交
114 115 116
- **项目同步仓库更新升级**

  项目同步仓库更新升级之后,建议 `pnpm install` 安装更新依赖之后启动 。
117
  
H
haoxr 已提交
118 119 120
- **其他问题**

  如果有其他问题或者建议,建议 [ISSUE](https://gitee.com/youlaiorg/vue3-element-admin/issues/new)
121

122
## 接口支持
123

124 125 126 127
- **接口调用地址**[https://vapi.youlai.tech](https://vapi.youlai.tech)
- **接口文档地址**[在线接口文档](https://www.apifox.cn/apidoc/shared-195e783f-4d85-4235-a038-eec696de4ea5)
- **OpenAPI文档地址**[http://vapi.youlai.tech/v3/api-docs](http://vapi.youlai.tech/v3/api-docs)
- **本地接口**:默认使用线上接口,你可以通过以下步骤完成本地接口环境搭建:
128

129
	> 1. 获取基于 `Java 、SpringBoot` 开发的后端 [youlai-boot](https://gitee.com/youlaiorg/youlai-boot.git) 源码 ;
130 131
	>2. 根据后端工程说明文档 [README.md](https://gitee.com/youlaiorg/youlai-boot#%E9%A1%B9%E7%9B%AE%E8%BF%90%E8%A1%8C) 完成本地启动; 
	> 3. 替换 [vite.config.ts](vite.config.ts) 的代理目标地址 `vapi.youlai.tech` 为本地的 `localhost:8989`
132 133 134



135
## 项目文档
136

137
- [基于 Vue3 + Vite4 + TypeScript + Element-Plus 从0到1搭建后台管理系统](https://blog.csdn.net/u013737132/article/details/130191394)
138

139 140
- [ESLint+Prettier+Stylelint+EditorConfig 约束和统一前端代码规范](https://blog.csdn.net/u013737132/article/details/130190788)
- [Husky + Lint-staged + Commitlint + Commitizen + cz-git 配置 Git 提交规范](https://blog.csdn.net/u013737132/article/details/130191363)
141 142


143 144


H
haoxr 已提交
145
## 提交规范
146

H
haoxr 已提交
147
执行 `pnpm run commit` 唤起 git commit 交互,根据提示完成信息的输入和选择。
H
haoxr 已提交
148

149
![](https://oss.youlai.tech/youlai-boot/2023/05/21/d9863c6ded9e4363824b0d8c4c1f0642.png)
H
haoxr 已提交
150

151
## 公众号🎉 
H
haoxr 已提交
152

H
haoxr 已提交
153
> 无广告,佛系公众号,随缘更新开源组织成员技术分享,期待您的关注!
154

H
haoxr 已提交
155
![](https://s2.loli.net/2023/05/28/JaG4L8ZHmkIgRQC.png)
156 157 158

## 交流群🚀

H
haoxr 已提交
159
> 如果交流群的二维码过期,请加我微信,备注「前端」、「后端」或「全栈」即可,我将邀请您加入对应的微信群。
160 161

![](https://s2.loli.net/2023/05/28/7vNjHTotb2h9zBD.png)
162