mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-12 12:54:48 +08:00
29 lines
443 B
JavaScript
29 lines
443 B
JavaScript
const CHANGE_CUR_UID = 'yapi/user/CHANGE_CUR_UID';
|
|
|
|
// Reducer
|
|
const initialState = {
|
|
curUid: "0"
|
|
};
|
|
|
|
export default (state = initialState, action) => {
|
|
switch (action.type) {
|
|
case CHANGE_CUR_UID: {
|
|
return {
|
|
...state,
|
|
curUid: action.data
|
|
};
|
|
}
|
|
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
// Action Creators
|
|
export function changeCurUid(curUid) {
|
|
return {
|
|
type: CHANGE_CUR_UID,
|
|
data: curUid
|
|
}
|
|
}
|