history.js 463 B

123456789101112131415161718192021222324252627
  1. // 阅读历史相关API
  2. const api = require('../utils/api');
  3. // 添加阅读历史
  4. function addHistory(contentId) {
  5. return api.post('/app/history/add', { contentId }, true);
  6. }
  7. // 获取阅读历史列表
  8. function getHistoryList() {
  9. return api.get('/app/history/list', {}, true);
  10. }
  11. // 清空阅读历史
  12. function clearHistory() {
  13. return api.del('/app/history/clear', {}, true);
  14. }
  15. module.exports = {
  16. addHistory,
  17. getHistoryList,
  18. clearHistory
  19. };