menu.ts 610 B

1234567891011121314151617181920212223
  1. import { request } from '@/utils/http'
  2. import type { ResultData } from '@/utils/http'
  3. export type MenuItem = {
  4. id: number
  5. title: string
  6. cover: string
  7. children: MenuItem[]
  8. grid: number
  9. styleType: number
  10. otherType: number
  11. description: string
  12. }
  13. export type CategoryItem = {
  14. id: number
  15. title: string
  16. children: MenuItem[]
  17. parentId: number
  18. remark: string
  19. }
  20. export const getMenuList = (): Promise<ResultData<MenuItem[]>> => request.get('web/menu')
  21. export const getCategoryTree = (id: number): Promise<ResultData<CategoryItem | CategoryItem[]>> =>
  22. request.get('web/category/tree', { id })