/*
 * @Author: 吴文洁
 * @Date: 2020-04-27 20:35:34
 * @LastEditors: wufan
 * @LastEditTime: 2020-12-01 15:23:22
 * @Description:
 */

import React, { useEffect, useState } from "react";
import ReactDOM from 'react-dom';
import { HashRouter } from 'react-router-dom';
import { ConfigProvider } from 'antd';
import { createHashHistory } from 'history';
import zh_CN from 'antd/es/locale/zh_CN';
import _ from 'underscore';
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosPromise } from 'axios';
import { RootRouter } from './routes/index';
import 'antd/dist/antd.less';
import '@/common/less/index.less';
import '@/core/function';
import User from '@/common/js/user';
import '@/common/less/index.less';

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 async function mount() {
  
  // useEffect(()=>{
  //   fetchUserInsts();
  // })

  // function fetchUserInsts(){
  //   const userId = User.getUserId();
    
  //   axios.post("hades/public/store/getUserStore",{ userId })
  //   .then((res: any) => {
  //      const { storeGroupVOS, storeVOS } = res.result;

  //   })
  // }

  ReactDOM.render(
   <RootRouter/>,
  document.getElementById('root'));
}

mount()