// react
import React from 'react';
import { render } from 'react-dom';
// react-router
import { createHashHistory } from 'History';
import { Router, Route, useRouterHistory, IndexRedirect } from 'react-router';
// mobx
import { Provider } from 'mobx-react';
// mobx-react-router
import { syncHistoryWithStore, RouterStore } from 'mobx-react-router';
import { WeaForm } from 'comsMobx';
import { WeaAlertPage, WeaLocaleProvider, WeaTools } from 'ecCom';
// components
import Entrance from './router/Entrance';
// import Content from "./router/Content"
const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'common');
// style
import './style';
// stores
const routing = new RouterStore();
const stores = {
routing,
weaFormStore: new WeaForm(),
};
const browserHistory = useRouterHistory(createHashHistory)({
queryKey: '_key',
basename: '/',
});
const history = syncHistoryWithStore(browserHistory, stores.routing);
const AuthPage = () => (
对不起,您暂时没有权限!
);
const onEnter = (nextState, replace, callback) => {
window.ssoChecked = false;
WeaTools.checkSSO('', false).then(() => {
getLocaleLabel(nextState, replace, callback);
});
};
const Root = () => (
{/* */}
);
try {
render(, document.getElementById('container'), () => { });
} catch (e) {
window.console ? console.log('出错了: ', e) : alert(`出错了:${e}`);
}