提交 7fc3df49 authored 作者: wtj's avatar wtj

提交缺少的model

上级 e65dda2a
......@@ -13,9 +13,9 @@ export default {
effects: {
*find({ payload, callback }, { call, put }) {
const response = yield call(apiRequest, api+"/find",payload);
if (response==null){yield put({type: 'nom'});return }
yield put({
type: 'nom',
payload: response,
......@@ -24,28 +24,36 @@ export default {
},
*add({ payload, callback }, { call, put }) {
const response = yield call(apiRequest, api+"/add",payload);
if (response==null){yield put({type: 'nom'});return }
yield put({
type: 'nom',
payload: response,
});
if (callback) callback({suc:true});
},
*changeType({ payload, callback }, { call, put }) {
const response = yield call(apiRequest, api+"/changeType",payload);
if (response==null){yield put({type: 'nom'});return }
yield put({
type: 'nom',
payload: response,
});
if (callback) callback({suc:true});
},
*fetch({ payload, callback }, { call, put }) {
const response = yield call(apiRequest, api+"/getPage",payload);
if (response==null){yield put({type: 'nom'});return }
yield put({
type: 'list',
payload: response,
});
},*remove({ payload, callback }, { call, put }) {
const response = yield call(apiRequest, api+"/remove",payload);
const response = yield call(apiRequest, api+"/remove",payload);
if (response==null){yield put({type: 'nom'});return }
yield put({
type: 'nom',
......@@ -54,14 +62,14 @@ export default {
if(callback){
callback()
}
},
},
reducers: {
list(state, { payload }) {
return {
...state,
......@@ -77,9 +85,9 @@ export default {
},
nom(state, action) {
return {...state, status: "ok" };
},
},
};
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论