1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- import BaseStore from '@src/stores/base';
- export default class MainStore extends BaseStore {
- /**
- * 获取首页配置
- */
- getIndex() {
- return this.apiGet('/base/index');
- }
- /**
- * 获取广告列表
- */
- getAd() {
- return this.apiGet('/base/ad');
- }
- /**
- * 获取对应位置的提示tips
- * @param {*} position
- */
- getTips(position) {
- return this.apiGet('/base/tips', { position });
- }
- /**
- * 获取考分排行信息
- */
- getScore(total, quant) {
- return this.apiGet('/base/score', { total, quant });
- }
- /**
- * 所有练习头2层
- */
- getExercise() {
- return this.getApiCache('API:main:getExercise', () => {
- return this.apiGet('/base/exercise/main');
- });
- }
- /**
- * 获取对应节点下的子节点
- * @param {*} id
- * @param {*} children
- */
- getExerciseChildren(id, children) {
- return this.apiGet('/base/exercise/children', { id, children });
- }
- /**
- * 获取对应节点的所有父级节点
- * @param {*} id
- */
- getExerciseParent(id) {
- return this.apiGet('/base/exercise/parent', { id });
- }
- /**
- * 所有模考层级
- */
- getExamination() {
- return this.getApiCache('API:main:getExamination', () => {
- return this.apiGet('/base/examination/main');
- });
- }
- /**
- * 获取对应节点下的子节点
- * @param {*} id
- * @param {*} children
- */
- getExaminationChildren(id, children) {
- return this.apiGet('/base/examination/children', { id, children });
- }
- /**
- * 获取对应节点的所有父级节点
- * @param {*} id
- */
- getExaminationParent(id) {
- return this.apiGet('/base/examination/parent', { id });
- }
- /**
- * 获取模考题目数
- */
- getExaminationNumber() {
- return this.getApiCache('API:main:getExaminationNumber', () => {
- return this.apiGet('/base/examination/number');
- });
- }
- }
- export const Main = new MainStore({ key: 'main' });
|