messageService.js
873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import BaseService from '../../libs/services/baseService.js';
const UFO_MESSAGE_TYPE = 'ufo.users.listInboxTypeInfo';
const UFO_MESSAGE_LIST = 'ufo.users.listInboxs';
export default class MessageService extends BaseService {
async fetchMessageTypeInfo(params, complete) {
return await this.GET(
{
...params,
method: UFO_MESSAGE_TYPE
},
{
complete
}
).then((data) => {
return data;
}).catch((error) => {
// 这里请抛出异常,不要return
throw error;
})
}
async fetchNewMessageList(params, complete) {
return await this.GET(
{
...params,
method: UFO_MESSAGE_LIST
},
{
complete
}
).then((data) => {
return data;
}).catch((error) => {
// 这里请抛出异常,不要return
throw error;
})
}
}