Performance.js
1.08 KB
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
41
import {policyList,performList,achievementRank} from '../services/performance';
import {Toast} from "antd-mobile"
export default {
namespace: 'Performance',
state: {
item: {},
},
effects: {
*policyList({ payload, callback ,error}, { call, put }) {
const { data } = yield call(policyList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*performList({ payload, callback, error}, { call, put }) {
const { data } = yield call(performList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error&& error(data)
}
},
*achievementRank({ payload, callback, error}, { call, put }) {
const { data } = yield call(achievementRank, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error&& error(data)
}
}
},
reducers: {
saveUser(state, { payload }) {
return { ...state, item: payload };
},
},
subscriptions: {
},
};