个人主页

This commit is contained in:
caishi 2020-05-08 10:36:31 +08:00
parent 326847f697
commit 73bacb789d
2 changed files with 16 additions and 1 deletions

View File

@ -67,6 +67,12 @@ const http500 = Loadable({
loader: () => import('./modules/500/http500'),
loading: Loading,
})
// 个人主页
const InfosIndex = Loadable({
loader: () => import('./modules/user/usersInfo/InfosIndex'),
loading: Loading,
})
class App extends Component {
constructor(props) {
@ -243,7 +249,16 @@ class App extends Component {
{/*404*/}
<Route path="/nopage" component={Shixunnopage} />
{/* 个人主页 */}
<Route path="/users/:username"
render={
(props) => {
return (<InfosIndex {...this.props} {...props} {...this.state} />)
}
}></Route>
<Route exact path="/"
render={
(props) => (<Projects {...this.props} {...props} {...this.state}></Projects>)

View File

@ -286,7 +286,7 @@ class InfosCourse extends Component {
<Create href={"/classrooms/new"} name={"新建课堂"} index="1"></Create> : ""
}
{
(!data || (data && data.courses.length === 0)) && (category || (!category && this.props.current_user && this.props.current_user.user_identity == "学生")) && <NoneData></NoneData>
(!data || (data && data.courses && data.courses.length === 0)) && (category || (!category && this.props.current_user && this.props.current_user.user_identity == "学生")) && <NoneData></NoneData>
}
{
data && data.courses && data.courses.map((item, key) => {