You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

89 lines
1.9 KiB

  1. /*
  2. * Copyright (c) 2018-2025, lengleng All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the pig4cloud.com developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: lengleng (wangiegie@gmail.com)
  16. */
  17. import request from '@/router/axios'
  18. export function roleList() {
  19. return request({
  20. url: '/admin/role/roleList',
  21. method: 'get'
  22. })
  23. }
  24. export function fetchList(query) {
  25. return request({
  26. url: '/admin/role/page',
  27. method: 'get',
  28. params: query
  29. })
  30. }
  31. export function deptRoleList() {
  32. return request({
  33. url: '/admin/role/list',
  34. method: 'get'
  35. })
  36. }
  37. export function getObj(id) {
  38. return request({
  39. url: '/admin/role/' + id,
  40. method: 'get'
  41. })
  42. }
  43. export function addObj(obj) {
  44. return request({
  45. url: '/admin/role',
  46. method: 'post',
  47. data: obj
  48. })
  49. }
  50. export function putObj(obj) {
  51. return request({
  52. url: '/admin/role',
  53. method: 'put',
  54. data: obj
  55. })
  56. }
  57. export function delObj(id) {
  58. return request({
  59. url: '/admin/role/' + id,
  60. method: 'delete'
  61. })
  62. }
  63. export function permissionUpd(roleId, menuIds) {
  64. return request({
  65. url: '/admin/role/menu',
  66. method: 'put',
  67. data: {
  68. roleId: roleId,
  69. menuIds: menuIds
  70. }
  71. })
  72. }
  73. export function fetchRoleTree(roleId) {
  74. return request({
  75. url: '/admin/menu/tree/' + roleId,
  76. method: 'get'
  77. })
  78. }