/*
 * @Author: 吴文洁
 * @Date: 2020-04-28 18:05:30
 * @LastEditors: 吴文洁
 * @LastEditTime: 2020-08-13 11:23:36
 * @Description: 
 */
import CloudClass from './config/cloudClass';

import {Redirect,Router, Route ,Switch} from 'react-router-dom';
import { createHashHistory } from 'history';
import App from '../modules/root/App';
import _ from 'underscore';
const history = createHashHistory();
window.RCHistory = _.extend({}, history, {
  push: (obj: any) => {
    history.push(obj)
  },
  pushState:  (obj: any) => {
    history.push(obj)
  },
  pushStateWithStatus: (obj: any) => {
    history.push(obj)
  },
  goBack: history.goBack,
	location: history.location,
	replace: (obj: any) => {
		history.replace(obj)
	}
});
export const RootRouter = () => {
	return (
		// <Router {...history}>
		// 	<Switch>
		// 		{/* <Route key="1" exact path="/login" render={() => <Login />} />
		// 		<Route key="6" path="/" render={() => <App dispatch={dispatch} state={state} />} /> */}
		// 	</Switch>
		// </Router>
	)
}
// export const MainRoutes = () => {
// 	return (
// 		<Switch>
// 			{
// 				_.map(renderRoutes, ({
// 					path,
// 					version,
// 					component,
// 					container,
// 					isMicroApp,
// 				}, key) => {
// 					if (isMicroApp) {
// 						return <Route
// 							key={key}
// 							path={path}
// 							render={() => {
// 								return <div id={container} />
// 							}}
// 						/>
// 					}

// 					if (!version) {
// 						return <Route
// 							key={key}
// 							path={path}
// 							render={() => {
// 								const Component = dynamic({ path, component })
// 								cache[path] = Component
// 								return <Component />
// 							}}
// 						/>
// 					} else if ((version === '5.0' && window.NewVersion) || (version !== '5.0' && !window.NewVersion)) {
// 						return <Route
// 							key={key}
// 							path={path}
// 							render={() => {
// 								const Component = dynamic({ path, component })
// 								cache[path] = Component
// 								return <Component />
// 							}}
// 						/>
// 					}
// 				})
// 			}
// 			<Route key="-1" exact path='/' render={() => (<Redirect to='/home' />)} />
// 		</Switch>
// 	)
// }