error.js 440 Bytes
Newer Older
愚道's avatar
愚道 committed
1
import { query } from '@/services/error';
陈帅's avatar
陈帅 committed
2 3 4 5 6 7 8 9 10 11

export default {
  namespace: 'error',

  state: {
    error: '',
    isloading: false,
  },

  effects: {
12 13
    *query({ payload }, { call, put }) {
      yield call(query, payload.code);
陈帅's avatar
陈帅 committed
14 15
      yield put({
        type: 'trigger',
16
        payload: payload.code,
陈帅's avatar
陈帅 committed
17 18 19 20 21 22 23 24 25 26 27 28
      });
    },
  },

  reducers: {
    trigger(state, action) {
      return {
        error: action.payload,
      };
    },
  },
};