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.
 
 
 

73 lines
1.7 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 getMenu(id) {
  19. return request({
  20. url: '/admin/menu',
  21. params: {parentId: id},
  22. method: 'get'
  23. })
  24. }
  25. export function getTopMenu() {
  26. return request({
  27. url: '/admin/menu',
  28. params: {type: 'top'},
  29. method: 'get'
  30. })
  31. }
  32. export function fetchMenuTree(lazy, parentId) {
  33. return request({
  34. url: '/admin/menu/tree',
  35. method: 'get',
  36. params: {lazy: lazy, parentId: parentId}
  37. })
  38. }
  39. export function addObj(obj) {
  40. return request({
  41. url: '/admin/menu',
  42. method: 'post',
  43. data: obj
  44. })
  45. }
  46. export function getObj(id) {
  47. return request({
  48. url: '/admin/menu/' + id,
  49. method: 'get'
  50. })
  51. }
  52. export function delObj(id) {
  53. return request({
  54. url: '/admin/menu/' + id,
  55. method: 'delete'
  56. })
  57. }
  58. export function putObj(obj) {
  59. return request({
  60. url: '/admin/menu',
  61. method: 'put',
  62. data: obj
  63. })
  64. }