12-23-上传master

This commit is contained in:
xingsy
2020-12-23 11:14:35 +08:00
parent 9769f83bc8
commit b42e0c1ddd
553 changed files with 56506 additions and 0 deletions

View File

@ -0,0 +1,48 @@
import { Effect, Reducer } from 'umi';
import { BasicGood } from './data.d';
import { queryBasicProfile } from './service';
export interface StateType {
basicGoods: BasicGood[];
}
export interface ModelType {
namespace: string;
state: StateType;
effects: {
fetchBasic: Effect;
};
reducers: {
show: Reducer<StateType>;
};
}
const Model: ModelType = {
namespace: 'profileBasic',
state: {
basicGoods: [],
},
effects: {
*fetchBasic(_, { call, put }) {
const response = yield call(queryBasicProfile);
yield put({
type: 'show',
payload: response,
});
},
},
reducers: {
show(state, { payload }) {
return {
...state,
...payload,
};
},
},
};
export default Model;