import {
  getPortalConfigAPI
} from "../services/api";

export default {
  namespace: "homeLayout",

  state: {},

  effects: {
    // 获取门户设置信息
    *getPortalConfig({ payload }, { call, put }) {
      const response = yield call(getPortalConfigAPI, payload);
      yield put({
        type: "portalConfig",
        portalConfig: response ? response.content : []
      });
    }
  },

  reducers: {
    portalConfig(state, payload) {
      return {
        ...state,
        portalConfig: payload.portalConfig
      };
    }
  }
};
