mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
35 lines
578 B
JavaScript
35 lines
578 B
JavaScript
|
import axios from 'axios';
|
||
|
|
||
|
// Actions
|
||
|
const GET_FOLLOW_LIST = 'yapi/follow/GET_FOLLOW_LIST';
|
||
|
|
||
|
// Reducer
|
||
|
const initialState = {
|
||
|
data: []
|
||
|
};
|
||
|
|
||
|
export default (state = initialState, action) => {
|
||
|
switch (action.type) {
|
||
|
case GET_FOLLOW_LIST: {
|
||
|
console.log(action);
|
||
|
return {
|
||
|
...state,
|
||
|
data: action.payload.data.data
|
||
|
};
|
||
|
}
|
||
|
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// Action Creators
|
||
|
export function getFollowList(uid) {
|
||
|
return {
|
||
|
type: GET_FOLLOW_LIST,
|
||
|
payload: axios.get('/api/follow/list', {
|
||
|
params: { uid }
|
||
|
})
|
||
|
}
|
||
|
}
|