# front **Repository Path**: uglyp/front ## Basic Information - **Project Name**: front - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-21 - **Last Updated**: 2025-05-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

element-admin-front

![](https://foruda.gitee.com/images/1708618984641188532/a7cca095_716974.png "rainbow.png") ## 项目特色 - **简洁易用**:基于 [vue-element-admin](https://gitee.com/panjiachen/vue-element-admin) 升级的 Vue3 版本,无过渡封装 ,易上手。 - **数据交互**: 支持 `Mock` 数据 - **系统功能:** 提供用户管理、角色管理、菜单管理、部门管理、字典管理等功能模块。 - **权限管理:** 支持动态路由、按钮权限、角色权限和数据权限等多种权限管理方式。 ## 开发指南 | 名称 | 地址 | |---------------|--------------------| | 项目搭建 | 基于 Vue3 + Vite + TypeScript + Element-Plus 从0到1搭建后台管理系统 | 代码规范 | ESLint V9 + Prettier + Stylelint + EditorConfig 约束和统一前端代码规范| | 提交规范 | Husky + Lint-staged + Commitlint + Commitizen + cz-git 配置 Git 提交规范| ## 项目启动 - **环境准备** | 环境类型 | 名称 | |----------------|-----------------------------| | **开发工具** | [Visual Studio Code](https://code.visualstudio.com/Download) | | **运行环境** | Node 18 + (推荐[22.9.0](https://npmmirror.com/mirrors/node/v22.9.0/)) | > ⚠️ 注意:Node.js 20.6.0版本存在兼容性问题,请勿使用 - **快速开始** ```bash # 安装 pnpm npm install pnpm -g # 设置镜像源(可忽略) pnpm config set registry https://registry.npmmirror.com # 安装依赖 pnpm install # 启动运行 pnpm run dev ``` ## 项目部署 执行 `pnpm run build` 命令后,项目将被打包并生成 `dist` 目录。接下来,将 `dist` 目录下的文件上传到服务器 `/usr/share/nginx/html` 目录下,并配置 Nginx 进行反向代理。 ```bash pnpm run build ``` 以下是 Nginx 的配置示例: ```nginx server { listen 80; server_name localhost; location / { root /usr/share/nginx/html; index index.html index.htm; } # 反向代理配置 location /prod-api/ { # 请将 http://xxxxx.com/ 替换为您的后端 API 地址,并注意保留后面的斜杠 / proxy_pass http://xxxxx.com/; } } ``` ## 本地Mock 项目同时支持在线和本地 Mock 接口,默认使用线上接口,如需替换为 Mock 接口,修改文件 `.env.development` 的 `VITE_MOCK_DEV_SERVER` 为 `true` **即可**。 ## 后端接口 1. 修改 `.env.development` 文件中的 `VITE_APP_API_URL` 的值,为对应的后端服务即可。 ## 注意事项 - **自动导入插件自动生成默认关闭** 模板项目的组件类型声明已自动生成。如果添加和使用新的组件,请按照图示方法开启自动生成。在自动生成完成后,记得将其设置为 `false`,避免重复执行引发冲突。 ![](https://foruda.gitee.com/images/1687755823137387608/412ea803_716974.png) - **项目启动浏览器访问空白** 请升级浏览器尝试,低版本浏览器内核可能不支持某些新的 JavaScript 语法,比如可选链操作符 `?.`。 - **项目同步仓库更新升级** 项目同步仓库更新升级之后,建议 `pnpm install` 安装更新依赖之后启动 。 - **项目组件、函数和引用爆红** 重启 VSCode 尝试 ## 提交规范 执行 `pnpm run commit` 唤起 git commit 交互,根据提示完成信息的输入和选择。 ![](https://foruda.gitee.com/images/1687755823165218215/c1705416_716974.png)