|
@@ -0,0 +1,151 @@
|
|
|
+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');
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改备考信息
|
|
|
+ * @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(questionNoId) {
|
|
|
+ return this.apiPut('/auth/collect', { questionNoId });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除收藏
|
|
|
+ * @param {*} questionNoId
|
|
|
+ */
|
|
|
+ delCollect(questionNoId) {
|
|
|
+ return this.apiDel('/auth/collect', { id: questionNoId });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取收藏题目列表
|
|
|
+ * @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 {*} 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' });
|