{"size": 1578, "ext": "js", "max_stars_repo_path": "frontend/src/router/index.js", "max_stars_repo_name": "wangfpp/face_coding", "max_stars_repo_stars_event_min_datetime": "2021-06-20T11:16:32.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-22T02:01:46.000Z", "max_issues_repo_path": "frontend/src/router/index.js", "max_issues_repo_name": "wangfpp/face_coding", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "frontend/src/router/index.js", "max_forks_repo_name": "wangfpp/face_coding", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.7735849057, "max_line_length": 77, "alphanum_fraction": 0.5525982256}
/*
 * @Author: fangxb
 * @Descripttion: 
 * @Date: 2020-02-09 10:20:42
 * @LastEditTime : 2020-02-10 15:15:26
 */
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import StorePersistor from '../store/index.js';
import AppRouter from './routes/index';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/es/locale/zh_CN.js'
import moment from 'moment';
import 'moment/locale/zh-cn';
const { store, persistor } = StorePersistor();

moment.locale('zh-cn');

class StoreRouter extends Component {
    UNSAFE_componentWillMount() {
        this.errorLog();//监听组件外异常
    }
    errorLog() {
        window.onerror = (message, file, line, column, errorObject) => {
            column = column || (window.event && window.event.errorCharacter);
            const stack = errorObject ? errorObject.stack : null;
            const data = {
                message: message,
                file: file,
                line: line,
                column: column,
                errorStack: stack,
            };
            console.log(data);
            return false;
        }
    }
    render() {
        return (
            <Provider store={store}>
                <PersistGate loading={null} persistor={persistor}>
                    <ConfigProvider locale={zhCN}>
                        <AppRouter>
                        </AppRouter>
                    </ConfigProvider>
                </PersistGate>
            </Provider>
        )
    }
}

export default StoreRouter;