diff --git a/src/App.js b/src/App.js index a4f411587..83ac6d764 100644 --- a/src/App.js +++ b/src/App.js @@ -46,6 +46,10 @@ const Projects = Loadable({ loader: () => import('./forge/Index'), loading: Loading, }) +const Home = Loadable({ + loader: () => import('./forge/Home'), + loading: Loading, +}) //403页面 const Shixunauthority = Loadable({ loader: () => import('./modules/403/Shixunauthority'), @@ -249,7 +253,7 @@ class App extends Component { ( - + ) } /> diff --git a/src/AppConfig.js b/src/AppConfig.js index 3299fdb06..e07996277 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -100,9 +100,10 @@ export function initAxiosInterceptors(props) { // TODO 读取到package.json中的配置? var proxy = "http://localhost:3000" // proxy = "https://pre-newweb.educoder.net" - // proxy = "https://testforgeplus.trustie.net/" + proxy = "https://testforgeplus.trustie.net/" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; + // 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制 const requestMap = {}; window.setfalseInRequestMap = function (keyName) { diff --git a/src/forge/Home.jsx b/src/forge/Home.jsx new file mode 100644 index 000000000..a7bae4d14 --- /dev/null +++ b/src/forge/Home.jsx @@ -0,0 +1,26 @@ +import React , { useEffect } from 'react'; +import { SnackbarHOC } from "educoder"; +import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC"; +import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC"; +import ProjectIndex from './Main/Index'; +import PersonIndex from './users/Infos'; + +import { Spin } from 'antd'; + +export default (CNotificationHOC()(SnackbarHOC()( + TPMIndexHOC((props)=>{ + const { pathname } = props.history.location; + const { current_user } = props; + useEffect(()=>{ + if(pathname === "/" && (current_user && current_user.login)){ + props.history.push(`/users/${current_user && current_user.login}`) + } + }) + return( + pathname === "/" && (current_user && current_user.login) ? + + : + + ) + }) +))) \ No newline at end of file diff --git a/src/forge/Index.js b/src/forge/Index.js index 0670179bb..ea8b57110 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -29,7 +29,6 @@ const ProjectDetail = Loadable({ class Index extends Component { render() { - console.log("ddd",document.cookie); return (
@@ -52,14 +51,6 @@ class Index extends Component { )} > - ( - - )} - />
);