Commit f26c16f0 by zhanghaozhe

Merge branch 'master' into study

parents 2a04d736 620df63e
import React, { useEffect } from 'react';
import React, { useEffect, useState } from 'react';
import { withRouter } from "react-router-dom";
import { compose } from "redux";
import { connect } from "react-redux";
import LoadingComponent from '@/common/Loading'
function Loading(props) {
const [isLoading, setLoadingState] = useState(true)
useEffect(() => {
let {user, location, history} = props
if (!user.isFetching) {
if (user.hasError) {
history.push('/passport', {from: location})
setLoadingState(false)
} else {
if (Object.values(user.data).every(item => !!item).length !== 0) {
history.push(location.pathname)
setLoadingState(false)
}
}
}
})
return (
<div className={'loading'}>
loading...
<div className={'loading-route'}>
<LoadingComponent isLoading={isLoading}/>
</div>
);
}
......
......@@ -19,7 +19,6 @@ import Passport from '@/components/passport';
import { Scholarship } from '@/components/scholarship/index';
import DrawDocument from '@/components/scholarship/DrawDocument/DrawDocument';
import PayOrder from '@/components/order/payOrder/PayOrder'
import Loading from '@/common/Loading'
const Coupons = loadable(() => import(/* webpackChunkName: 'coupons'*/ '@/components/coupons'))
const Study = loadable(() => import(/* webpackChunkName: 'study'*/'@/components/study'))
......@@ -138,9 +137,4 @@ export default [
component: ToGroup,
isPrivate: true
},
{
path: '/loading',
component: Loading,
},
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment