index.js 322 Bytes
Newer Older
1 2 3 4
import { login } from '../services';

const initData = {};
export default {
duanledexianxianxian's avatar
duanledexianxianxian committed
5
  namespace: 'userLogin',
6 7 8 9 10 11 12 13 14 15 16 17 18
  state: {
    ...initData,
  },
  effects: {
    *login({ payload }, { call }) {
      const res = yield call(login, payload);
      return res;
    },
  },
  reducers: {
    clearData: () => ({ ...initData }),
  },
};