article.js 545 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * 文章相关API
  3. */
  4. import {http,Method} from '@/utils/request.js';
  5. import api from '@/config/api.js';
  6. /**
  7. * 获取某个分类的文章列表
  8. * @param category_type
  9. */
  10. export function getArticleCategory(category_type) {
  11. return http.request({
  12. url: `${api.base}/pages/article-categories`,
  13. method: Method.GET,
  14. params: {category_type},
  15. });
  16. }
  17. /**
  18. * 获取文章详情
  19. * @param type
  20. */
  21. export function getArticleDetail(type) {
  22. return http.request({
  23. url: `/article/type/${type}`,
  24. method: Method.GET,
  25. });
  26. }