sentence.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import BaseStore from '@src/stores/base';
  2. export default class SentenceStore extends BaseStore {
  3. /**
  4. * 所有长难句信息
  5. */
  6. getInfo() {
  7. return this.apiGet('/sentence/info');
  8. }
  9. /**
  10. * 激活长难句
  11. * @param {*} code
  12. */
  13. active(code) {
  14. return this.apiPut('/sentence/active', { code });
  15. }
  16. /**
  17. * 文章列表
  18. * @param {*} chapter
  19. */
  20. listArticle() {
  21. return this.apiGet('/sentence/article/list');
  22. }
  23. /**
  24. * 获取文章详情
  25. * @param {*} articleId
  26. */
  27. detailArticle(articleId) {
  28. return this.apiGet('/sentence/article/detail', { articleId });
  29. }
  30. /**
  31. * 更新长难句文章进度
  32. * @param {*} chapter
  33. * @param {*} part
  34. * @param {*} process
  35. * @param {*} time
  36. * @param {*} currentChapter
  37. * @param {*} currentPart
  38. */
  39. updateProcess(chapter, part, process, time, currentChapter, currentPart) {
  40. return this.apiPut('/sentence/article/process', { chapter, part, process, time, currentChapter, currentPart });
  41. }
  42. }
  43. export const Sentence = new SentenceStore({ key: 'sentence' });