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