{"id":18726789,"url":"https://github.com/pmg1989/dva-admin","last_synced_at":"2025-04-09T15:07:48.987Z","repository":{"id":41158180,"uuid":"81316787","full_name":"pmg1989/dva-admin","owner":"pmg1989","description":"dva admin antd dashboard","archived":false,"fork":false,"pushed_at":"2017-12-28T02:31:38.000Z","size":20137,"stargazers_count":283,"open_issues_count":26,"forks_count":93,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-09T15:07:37.507Z","etag":null,"topics":["admin","antd","axios","dashboard","dva","dva-admin","immutablejs","mock","react","redux"],"latest_commit_sha":null,"homepage":"https://pmg1989.github.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmg1989.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-08T10:17:40.000Z","updated_at":"2025-03-10T13:00:00.000Z","dependencies_parsed_at":"2022-09-01T17:32:46.972Z","dependency_job_id":null,"html_url":"https://github.com/pmg1989/dva-admin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmg1989%2Fdva-admin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmg1989%2Fdva-admin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmg1989%2Fdva-admin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmg1989%2Fdva-admin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmg1989","download_url":"https://codeload.github.com/pmg1989/dva-admin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055284,"owners_count":21040157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin","antd","axios","dashboard","dva","dva-admin","immutablejs","mock","react","redux"],"created_at":"2024-11-07T14:15:29.216Z","updated_at":"2025-04-09T15:07:48.962Z","avatar_url":"https://github.com/pmg1989.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dva-admin\n\n[![React Native](https://img.shields.io/badge/react-^15.4.1-brightgreen.svg?style=flat-square)](https://github.com/facebook/react)\n[![Ant Design](https://img.shields.io/badge/ant--design-^2.8.2-yellowgreen.svg?style=flat-square)](https://github.com/ant-design/ant-design)\n[![dva](https://img.shields.io/badge/dva-^1.1.0-orange.svg?style=flat-square)](https://github.com/dvajs/dva)\n\n[![GitHub issues](https://img.shields.io/github/issues/pmg1989/dva-admin.svg?style=flat-square)](https://github.com/pmg1989/dva-admin/issues)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/pmg1989/dva-admin/pulls)\n[![MIT](https://img.shields.io/dub/l/vibe-d.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n\n## 目的\n\n- 期望打造一套基于[react](https://github.com/facebook/react)，[ant-design](https://github.com/ant-design/ant-design)，[dva](https://github.com/dvajs/dva)于一体的、企业级后台管理系统\n- 期望可以单纯由前端来解决用户权限，后端提供权限数据支持的一套完善的权限管理功能后台管理系统\n- 期望可以在antd与dva的基础上，再次封装简单且可复用的基类组件，方便使用者简单接入，简单使用，简单拓展\n\n## 演示地址\n\nhttps://pmg1989.github.io\n\n#### 登录账号\n\n-  管理员账号：admin，密码：admin\n-  游客账号：guest, 密码：guest\n- 由于gitpage是静态服务器，刷新后会出现404是正常现象，部署正式服务器即可，具体服务端配置可参见[dva issues 180](https://github.com/dvajs/dva/issues/180)\n\n## 特性\n\n- 基于[react](https://github.com/facebook/react)，[ant-design](https://github.com/ant-design/ant-design)，[dva](https://github.com/dvajs/dva)，[Mock](https://github.com/nuysoft/Mock) 企业级后台管理系统最佳实践\n- 基于[Mock](https://github.com/nuysoft/Mock)实现脱离后端独立开发\n- 基于Antd UI 设计语言，提供后台管理系统常见使用场景\n- 浅度响应式设计\n- webpack打包处理路由时，实现Javascript模块化按需动态dynamic加载\n- 已实现基本完善的权限管理功能\n- 完善的后端分页与前端分页功能\n- 封装好可扩展的上传控件与音视频控件\n- 用[roadhog](https://github.com/sorrycc/roadhog)本地调试和构建，其中Mock功能实现脱离后端独立开发。\n\n## 开发及构建\n\n### 目录结构\n\n```bash\n├── /dist/           # 项目输出目录\n├── /src/            # 项目源码目录\n│ ├── /public/       # 公共文件，编译时copy至dist目录\n│ ├── /components/   # UI组件及UI相关方法\n│ │ ├── skin.less    # 全局样式\n│ │ └── vars.less    # 全局样式变量\n│ ├── /routes/       # 路由组件\n│ │ └── App/index.js       # 路由入口\n│ ├── /models/       # 数据模型\n│ ├── /services/     # 数据接口\n│ ├── /themes/       # 项目样式\n│ ├── /mock/         # 数据mock\n│ ├── /utils/        # 工具函数\n│ │ ├── config.js    # 项目常规配置\n│ │ ├── menu.js      # 菜单及面包屑配置\n│ │ ├── config.js    # 项目常规配置\n│ │ ├── request.js   # 异步请求函数\n│ │ └── theme.js     # 项目需要在js中使用到样式变量\n│ ├── route.js       # 路由配置\n│ ├── index.js       # 入口文件\n│ └── index.html     \n├── package.json     # 项目信息\n├── .eslintrc        # Eslint配置\n└── .roadhogrc.js    # roadhog配置\n```\n\n### 快速开始\n\n克隆项目文件:\n\n```\ngit clone git@github.com:pmg1989/dva-admin.git\n```\n\n进入目录安装依赖:\n\n```\nnpm install 或者 yarn 或者 yarn install\n```\n\n开发：\n\n```bash\nnpm run build:dll #第一次npm run dev时需运行此命令，使开发时编译更快\nnpm run dev\n\n打开 http://localhost:8000\n```\n\n\n构建：\n\n```bash\nnpm run build\n\n将会打包至dist/{version}目录 #package.json里version字段\n\nnpm run build:new\n\n将会打包至dist/{version增加1}目录 #package.json里version字段\n```\n\n代码检测：\n\n```bash\ngit项目提交时，会自动run precommit 进而执行 npm run lint，执行esLint代码检测\n```\n\n### 注意事项\n\n- 如需重写antd样式配置，请修改`src/theme.js`\n- 项目配置文件在`src/utils/config.js`\n- 如需重写异步请求函数，请修改`src/utils/request.js`\n  （关于为什么使用axios而不是fetch：在一个无服务器的环境中模拟数据请求，[Mock](https://github.com/nuysoft/Mock)不能拦截Fetch，只能拦截XHR，所以我选了一个纯Ajax的库[axios](https://github.com/mzabriskie/axios)）\n\n### 特别感谢\n\nzuiidea: [https://github.com/zuiidea/antd-admin](https://github.com/zuiidea/antd-admin)\n\nsorrycc: [https://github.com/dvajs/dva-example-user-dashboard](https://github.com/dvajs/dva-example-user-dashboard)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmg1989%2Fdva-admin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmg1989%2Fdva-admin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmg1989%2Fdva-admin/lists"}