{"id":13455631,"url":"https://github.com/pansyjs/react-admin","last_synced_at":"2025-04-04T08:05:17.822Z","repository":{"id":40310819,"uuid":"142545773","full_name":"pansyjs/react-admin","owner":"pansyjs","description":"🎉 A magical react admin","archived":false,"fork":false,"pushed_at":"2025-03-27T02:54:46.000Z","size":8340,"stargazers_count":196,"open_issues_count":12,"forks_count":28,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-28T07:04:03.706Z","etag":null,"topics":["admin","admin-template","ant-design","less","react","single-page-app","typescript","umi"],"latest_commit_sha":null,"homepage":"https://react-admin-site.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pansyjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-27T07:48:04.000Z","updated_at":"2024-10-09T03:23:13.000Z","dependencies_parsed_at":"2024-02-05T05:31:56.407Z","dependency_job_id":"2e0a02e5-ffeb-4bb3-a53a-93c89bbabce1","html_url":"https://github.com/pansyjs/react-admin","commit_stats":{"total_commits":717,"total_committers":6,"mean_commits":119.5,"dds":"0.15062761506276146","last_synced_commit":"a12b3579845690808d76fea5ea4ee7f02069b2f7"},"previous_names":[],"tags_count":5,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pansyjs%2Freact-admin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pansyjs%2Freact-admin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pansyjs%2Freact-admin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pansyjs%2Freact-admin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pansyjs","download_url":"https://codeload.github.com/pansyjs/react-admin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247140657,"owners_count":20890476,"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","admin-template","ant-design","less","react","single-page-app","typescript","umi"],"created_at":"2024-07-31T08:01:08.432Z","updated_at":"2025-04-04T08:05:17.803Z","avatar_url":"https://github.com/pansyjs.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/ts-react/react-admin-template\"\u003e\n    \u003cimg width=\"100\" src=\"https://github.com/ts-react/react-admin-template/blob/gh-pages/assets/logo.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eReact Admin Template\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n开箱即用的中台前端/设计解决方案。\n\u003c/div\u003e\n\n## ✨ 特性\n\n- 🛡 **TypeScript**: 应用程序级 JavaScript 的语言\n- 💎 **优雅美观**：基于 Ant Design 体系精心设计\n- 🚀 **最新技术栈**：使用 React/umi/antd 等前端前沿技术开发\n- 🌐 **国际化**：内建业界通用的国际化方案\n- 🔢 **Mock 数据**：实用的本地数据调试方案\n- ⚙️  **最佳实践**：良好的工程实践助您持续产出高质量代码\n- 🔐 **优秀的权限设计**：目前能找到的最好的权限实现方案\n\n## 🎉 推荐\n\n- 微前端版本 [micro-frontends-template](https://github.com/pansyjs/micro-frontends-template) 正在同步开发中...\n- 好用的水印组件 [watermark](https://github.com/pansyjs/watermark)\n\n\n## 📜 目录\n\n```\n├── config                     # umi 相关配置\n├── docker                     # docker 相关配置\n├── mock                       # 本地模拟数据\n├── public                     # 静态资源\n├── src                        # 源代码\n│   ├── assets                 # 本地静态资源\n│   ├── common                 # 类型定义、常量\n│   ├── components             # 全局公用组件\n│   ├── config                 # 全局配置\n│   ├── layouts                # 布局文件\n│   ├── locales                # 国际化资源\n│   ├── models                 # 路由\n│   ├── pages                  # 业务页面入口和常用模板\n│   ├── services               # 所有请求\n│   ├── utils                  # 全局公用方法\n│   ├── app.tsx                # 运行时配置文件\n│   ├── authority.ts           # 权限定义文件\n│   ├── global.less            # 全局样式\n│   └── typings.d.ts           # 补充类型定义\n├── package.json               # package.json\n└── tsconfig.json              # tsconfig.json\n```\n\n## 🔐  关于权限\n\n基于 [umi-plugin-authority](https://github.com/alitajs/umi-plugins/tree/master/packages/umi-plugin-authority) 提供权限功能，暴露 `useAuthority` hooks 和 `Authority` 组件实现权限控制的能力\n\n使用示例如下\n\n```tsx\nimport React from 'react';\nimport { useAuthority, Authority } from 'umi';\n\nconst PageA = props =\u003e {\n  const { foo } = props;\n  const { combinationVerify } = useAuthority();\n \n  // 使用 hooks 提供的能力  \n  if (combinationVerify('module1/action1')) {\n    // 存在 module1/action1 权限，则...\n  }\n  \n  return (\n    \u003cdiv\u003e\n      {/** 指定需要验证的权限 */}\n      \u003cAuthority\n        access=\"module1/action1\"\n        fallback={\u003cdiv\u003eCan not read foo content.\u003c/div\u003e}\n      \u003e\n        Foo content.\n      \u003c/Authority\u003e\n      {/** 直接指定权限 */}\n      \u003cAuthority\n        accessible={combinationVerify('module1/action1')}\n        fallback={\u003cdiv\u003eCan not update foo.\u003c/div\u003e}\n      \u003e\n        Update foo.\n      \u003c/Access\u003e\n      {/** 复杂的校验 */}\n      \u003cAuthority\n        accessible={combinationVerify('(module1/action1 || module1/action2) \u0026\u0026 module1/action3')}\n        fallback={\u003cdiv\u003eCan not update foo.\u003c/div\u003e}\n      \u003e\n        Update foo.\n      \u003c/Access\u003e\n      {/** children 为function */}\n      \u003cAuthority\n        accessible={combinationVerify('module3/action1')}\n        fallback={\u003cdiv\u003eCan not delete foo.\u003c/div\u003e}\n      \u003e\n        {(isMatch) =\u003e \u003cspan\u003e权限校验结果: {isMatch}\u003c/span\u003e}\n      \u003c/Authority\u003e\n    \u003c/div\u003e\n  );\n};\n```\n\n## ⌨️ 本地开发\n\n```sh\n# 克隆项目到本地\ngit clone git@github.com:ts-react/react-admin-template.git\n\n# 切换到项目目录\ncd ./react-admin-template\n\n# 安装依赖\nyarn\n\n# 启动服务\nnpm run start\n```\n\n## 🖥  支持环境\n\n现代浏览器及 IE11。\n\n| [\u003cimg src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png\" alt=\"IE / Edge\" width=\"24px\" height=\"24px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eIE / Edge | [\u003cimg src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png\" alt=\"Firefox\" width=\"24px\" height=\"24px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eFirefox | [\u003cimg src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png\" alt=\"Chrome\" width=\"24px\" height=\"24px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eChrome | [\u003cimg src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png\" alt=\"Safari\" width=\"24px\" height=\"24px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eSafari | [\u003cimg src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png\" alt=\"Opera\" width=\"24px\" height=\"24px\" /\u003e](http://godban.github.io/browsers-support-badges/)\u003c/br\u003eOpera |\n| --- | --- | --- | --- | --- |\n| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |\n\n## 👥 社区互助\n\n| Github Issue                                      | 钉钉群                                                                                     | 微信群                                                                                   |\n| ------------------------------------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |\n| [issues](https://github.com/ts-react/react-admin-template/issues) | \u003cimg src=\"https://github.com/alitajs/alita/blob/master/public/dingding.png\" width=\"100\" /\u003e | \u003cimg src=\"https://github.com/alitajs/alita/blob/master/public/wechat.png\" width=\"100\" /\u003e |\n","funding_links":[],"categories":["TypeScript","目录"],"sub_categories":["\u003ca id=\"project\"\u003e项目\u003c/a\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpansyjs%2Freact-admin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpansyjs%2Freact-admin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpansyjs%2Freact-admin/lists"}