|
|
@@ -1,28 +0,0 @@
|
|
|
-import { queryServicecont } from '@/services/servicelist'
|
|
|
-
|
|
|
-export default {
|
|
|
- namespace: 'servicelist',
|
|
|
- state: {
|
|
|
- lists: []
|
|
|
- },
|
|
|
- // 用于处理异步操作和业务逻辑,由action触发,但不能修改state
|
|
|
- effects: {
|
|
|
- *fetch({ payload }, { call, put }) {
|
|
|
- const response = yield call(queryServicecont, payload)
|
|
|
- yield put({
|
|
|
- type: 'show',
|
|
|
- payload: response
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- // reducers:用于处理同步操作,由action触发,可修改state
|
|
|
- reducers: {
|
|
|
- // action:是由reducers及effects的触发器,一般是第一个对象,如:{type:'add',payload:todo}
|
|
|
- show(state, action) {
|
|
|
- return {
|
|
|
- ...state,
|
|
|
- lists: action.payload
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|