collection.js 765 B

123456789101112131415161718192021222324252627282930313233343536
  1. import request from '../utils/request';
  2. // 查询收藏列表
  3. export function listCollection(query) {
  4. return request({
  5. url: '/miniapp/collection/list',
  6. method: 'GET',
  7. params: query
  8. });
  9. }
  10. // 添加收藏
  11. export function addCollection(data) {
  12. return request({
  13. url: '/miniapp/collection',
  14. method: 'POST',
  15. data: data
  16. });
  17. }
  18. // 取消收藏
  19. export function delCollection(id) {
  20. return request({
  21. url: '/miniapp/collection/' + id,
  22. method: 'DELETE'
  23. });
  24. }
  25. // 检查是否已收藏
  26. export function checkCollection(studentId, targetId, type) {
  27. return request({
  28. url: '/miniapp/collection/check',
  29. method: 'GET',
  30. params: { studentId, targetId, type }
  31. });
  32. }