API.ts 552 B

1234567891011121314151617181920212223242526272829303132
  1. import { request } from 'umi';
  2. export async function addRole(data: string){
  3. return request('/api/admin/role',{
  4. method:'post',
  5. data,
  6. });
  7. }
  8. export async function getPermissions(){
  9. return request('/api/admin/permissions',{
  10. method:'post',
  11. });
  12. }
  13. export async function deleteRole(data: string){
  14. return request('/api/admin/role/delete',{
  15. method:'post',
  16. data
  17. });
  18. }
  19. export async function getRolePermission(id: string){
  20. return request('/api/admin/role/rolePermission',{
  21. method:'post',
  22. data:{
  23. id
  24. }
  25. });
  26. }