123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- import BaseStore from '@src/stores/base';
- export default class MyStore extends BaseStore {
- /**
- * 绑定邮箱
- * @param {*} email 邮箱
- */
- bindEmail(email) {
- return this.apiPost('/auth/email', { email });
- }
- /**
- * 修改用户信息
- * @param {*} info nickname avatar
- */
- editInfo(info) {
- return this.apiPost('/auth/info', { ...info });
- }
- /**
- * 实名认证
- * @param {*} file
- */
- real(file) {
- return this.apiForm('/auth/real', { file });
- }
- /**
- * 用户站内信
- * @param {*} page
- * @param {*} size
- * @param {*} type
- * @param {*} read
- */
- message(page, size, type, read) {
- return this.apiGet('/auth/message', { page, size, type, read });
- }
- /**
- * 读取用户消息/全部
- */
- readAllMessage() {
- return this.apiPut('/auth/message/read', { all: true });
- }
- /**
- * 读取用户消息
- */
- readMessage(id) {
- return this.apiPut('/auth/message/read', { all: false, id });
- }
- /**
- * 修改备考信息
- * @param {*} info prepareStatus: 身份 prepareGoal: 目标分数 prepareExaminationTime: 考试时间 prepareScoreTime: 出分时间
- */
- editPrepare(info) {
- return this.apiPut('/auth/prepare', { ...info });
- }
- /**
- * 获取备考信息
- */
- getPrepare() {
- return this.apiGet('/auth/prepare');
- }
- /**
- * 获取学习记录
- * @param {*} date 时间
- */
- getStudy(date) {
- return this.apiGet('/auth/study', { date });
- }
- /**
- * 添加收藏
- * @param {*} questionNoId
- */
- addCollect(module, questionNoId) {
- return this.apiPut('/auth/collect', { module, questionNoId });
- }
- /**
- * 删除收藏
- * @param {*} questionNoId
- */
- delCollect(module, questionNoId) {
- return this.apiDel('/auth/collect', { module, id: questionNoId });
- }
- /**
- * 收藏卷组
- * @param {*} ids
- */
- bindCollect(ids) {
- return this.apiPost('/auth/collect/bind', { questionNoIds: ids });
- }
- /**
- * 获取收藏题目列表
- * @param {*} module
- * @param {*} type
- * @param {*} page
- * @param {*} size
- * @param {*} startTime
- * @param {*} endTime
- * @param {*} order
- * @param {*} direction
- */
- listCollect(module, type, page, size, startTime, endTime, order, direction) {
- return this.apiGet('/auth/collect/question', { module, type, page, size, startTime, endTime, order, direction });
- }
- /**
- * 获取错题列表
- * @param {*} module
- * @param {*} type
- * @param {*} page
- * @param {*} size
- */
- listError(module, type, page, size) {
- return this.apiGet('/auth/error/list', { module, type, page, size });
- }
- /**
- * 错题组卷
- * @param {*} ids
- * @param {*} times
- */
- bindError(ids, times) {
- return this.apiPost('/auth/error/bind', { questionNoIds: ids, filterTimes: times });
- }
- /**
- * 错题移除
- * @param {*} ids
- */
- clearError(ids) {
- return this.apiPost('/auth/error/clear', { questionNoIds: ids });
- }
- /**
- * 更新笔记
- * @param {*} questionNoId
- * @param {*} content
- */
- updateNote(questionNoId, content) {
- return this.apiPut('/auth/note', { questionNoId, content });
- }
- /**
- * 获取笔记列表
- * @param {*} module
- * @param {*} type
- * @param {*} page
- * @param {*} size
- * @param {*} startTime
- * @param {*} endTime
- * @param {*} order
- * @param {*} direction
- */
- noteList(module, type, page, size, startTime, endTime, order, direction) {
- return this.apiGet('/auth/note/list', { module, type, page, size, startTime, endTime, order, direction });
- }
- /**
- * 获取报告列表
- * @param {*} module
- * @param {*} type
- * @param {*} page
- * @param {*} size
- * @param {*} startTime
- * @param {*} endTime
- * @param {*} order
- * @param {*} direction
- */
- reportList(module, type, page, size, startTime, endTime, order, direction) {
- return this.apiGet('/auth/report/list', { module, type, page, size, startTime, endTime, order, direction });
- }
- }
- export const My = new MyStore({ key: 'my' });
|