初始化 antd-pro
This commit is contained in:
28
admin-web/src/models/project.js
Normal file
28
admin-web/src/models/project.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { queryProjectNotice } from '@/services/api';
|
||||
|
||||
export default {
|
||||
namespace: 'project',
|
||||
|
||||
state: {
|
||||
notice: [],
|
||||
},
|
||||
|
||||
effects: {
|
||||
*fetchNotice(_, { call, put }) {
|
||||
const response = yield call(queryProjectNotice);
|
||||
yield put({
|
||||
type: 'saveNotice',
|
||||
payload: Array.isArray(response) ? response : [],
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
reducers: {
|
||||
saveNotice(state, action) {
|
||||
return {
|
||||
...state,
|
||||
notice: action.payload,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user