index.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import request from '@/config/axios'
  2. export interface ArticleVO {
  3. id: number
  4. categoryId: number
  5. title: string
  6. author: string
  7. picUrl: string
  8. introduction: string
  9. browseCount: string
  10. sort: number
  11. status: number
  12. spuId: number
  13. recommendHot: boolean
  14. recommendBanner: boolean
  15. content: string
  16. }
  17. // 查询文章管理列表
  18. export const getArticlePage = async (params) => {
  19. return await request.get({ url: `/promotion/article/page`, params })
  20. }
  21. // 查询文章管理详情
  22. export const getArticle = async (id: number) => {
  23. return await request.get({ url: `/promotion/article/get?id=` + id })
  24. }
  25. // 新增文章管理
  26. export const createArticle = async (data: ArticleVO) => {
  27. return await request.post({ url: `/promotion/article/create`, data })
  28. }
  29. // 修改文章管理
  30. export const updateArticle = async (data: ArticleVO) => {
  31. return await request.put({ url: `/promotion/article/update`, data })
  32. }
  33. // 删除文章管理
  34. export const deleteArticle = async (id: number) => {
  35. return await request.delete({ url: `/promotion/article/delete?id=` + id })
  36. }
  37. // 导出文章管理 Excel
  38. export const exportArticle = async (params) => {
  39. return await request.download({ url: `/promotion/article/export-excel`, params })
  40. }