article.ts 831 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * 获取文章栏目
  3. */
  4. export function getArticleCategory() {
  5. return request.get(`article/category`)
  6. }
  7. /**
  8. * 文章列表
  9. */
  10. export function getArticleList(params: Record<string, any>) {
  11. return request.get('article/list', params)
  12. }
  13. /**
  14. * 获取文章热门推荐
  15. */
  16. export function getArticleHot(params: Record<string, any>) {
  17. return request.get(`article/hot`,params)
  18. }
  19. /**
  20. * 获取文章详情
  21. */
  22. export function getArticleInfo(id: number) {
  23. return request.get(`article/${ id }`)
  24. }
  25. /**
  26. * 文章列表
  27. */
  28. export function getArticleAll(params: Record<string, any>) {
  29. return request.get('article/all', params)
  30. }
  31. /**
  32. * 增加文章访问量
  33. */
  34. export function incVisit(id: any) {
  35. return request.put(`article/incVisit/${ id }`, {}, { showErrorMessage: false, showSuccessMessage: false })
  36. }