import { message } from 'antd';

import { routerRedux } from 'dva/router'

export default {
  namespace: 'History',
  state: {
    pageData: null,
    history_url:null,
  },

  reducers: {
    PageData(state, { pageData }) {
      return { ...state, pageData };
    },
    returnURL(state, { history_url }) {
      return { ...state, history_url};
    },

  },

  effects: {
    
    //页面处理
    *PAGE({playload}, {put}) {      
      let pageData = playload;
      yield put({ type: 'PageData', pageData, });
    },
    
    //链接
    *URL({ playload }, { put }) {
      let history_url = playload;
      console.log("保存地址"+JSON.stringify(playload));      
      yield put({ type: 'returnURL', history_url});
    },
    *URLCLEAR({  }, { put }) {
      let history_url = null;   
      yield put({ type: 'returnURL', history_url});
    }
    
  },
};
