import React from 'react';
import { render } from 'react-dom'
import './index.less';
import App from './App';
import { Provider } from 'react-redux'
import configureStore from './store/reducerExtras/configureStore'
import utils from '@api/index';
import { ConfigProvider } from 'antd'
import zhCN from 'antd/lib/locale/zh_CN';


const { interceptors } = utils;
const store = configureStore();
interceptors();       //拦截所有请求，401跳登录
const renderApp = () =>
    render(
        <ConfigProvider locale={zhCN} >
            <Provider store={store}>
                <App />
            </Provider>
        </ConfigProvider>,
        document.getElementById('root')
    )

if (process.env.NODE_ENV !== 'production' && module.hot) {
    module.hot.accept('./App', renderApp)
}

renderApp();

