Giter Site home page Giter Site logo

pspglb / ant-design-pro-permisson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kyronbao/ant-design-pro-permisson

0.0 1.0 0.0 2.65 MB

Add RBAC permission for ant-design-pro

License: MIT License

JavaScript 90.63% Dockerfile 0.02% CSS 9.27% HTML 0.07%

ant-design-pro-permisson's Introduction

Ant Design Pro Permission

项目说明

ant-design/ant-design-pro添加了权限管理(RBAC)的一些模板,目前实现了

  • 员工列表展示
    • 员工角色管理
  • 角色管理
    • 角色权限管理
  • 权限管理
  • 菜单管理

另外由于常用查询表格模板,官方的功能较多,我加了两个简化的版本

  • 列表页
    • 查询表格简版1(删除了搜索筛选的展开功能)
    • 查询表格简版2(删除了搜索筛选的展开功能,配置的模态框去掉下一步功能)

感谢 ant-design-pro 组的贡献
目前流程已经跑通,后端API我使用Laravel实现,代码在这里 https://github.com/kyronbao/laravel-permission-api
欢迎试用, star 支持 ❤️

截图

使用

本地可以使用 npm start 启动,

调试API使用 npm run start:no-mock,约定 /admin 路由使用代理请求后端服务, config.js如下

proxy: {
    '/admin': {
      target: 'http://you-api-server/',
    },
  },

上线nginx相应配置

location /admin {
                proxy_pass http://you-api-server;
                proxy_set_header   X-Forwarded-Proto $scheme;
                proxy_set_header   Host              $http_host;
                proxy_set_header   X-Real-IP         $remote_addr;
        }

具体参考 http://pro.ant.design/docs/getting-started-cn

一些细节

  • 不同角色的菜单直接从后端获取,前端不需要验证
  • 不同角色的权限可以在后端判断,所以登录时authority默认给了admin值(models/login.js:79)
  • post相关的接口都使用批量提交,减少了代码量

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.