diff --git a/src/App.js b/src/App.js index f25c8f06..288b2a19 100644 --- a/src/App.js +++ b/src/App.js @@ -52,6 +52,19 @@ const SoftwareFactory = Loadable({ loader: () => import('./factory/index'), loading: Loading, }) + +const SoftwareFactoryResource = Loadable({ + loader: () => import('./factory/resource/index'), + loading: Loading, +}) + + +const SoftwareFactoryScene = Loadable({ + loader: () => import('./factory/scene/index'), + loading: Loading, +}) + + //forge安全设置 const Security = Loadable({ loader: () => import('./forge/SecuritySetting/Index'), @@ -129,12 +142,12 @@ const LoginRegisterPage = Loadable({ const AboutUs = Loadable({ - loader: () => import("./forge/AboutUs/AboutUs"), - loading: Loading, + loader: () => import("./forge/AboutUs/AboutUs"), + loading: Loading, }) const Teaching = Loadable({ - loader : () => import("./forge/TeachingPractice/Teaching"), + loader: () => import("./forge/TeachingPractice/Teaching"), loading: Loading, }) @@ -147,7 +160,7 @@ const ConfigurateBot = Loadable({ loading: Loading, }); const SoftBot = Loadable({ - loader : () => import("./softbot"), + loader: () => import("./softbot"), loading: Loading, }) @@ -181,7 +194,7 @@ const GovernanceIframe = Loadable({ }); // 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。 -const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone", "hiagent","softwareFactory", "development", "governance"]; +const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus", "educoder", "glcc", "bindlogin", "softbot", "zone", "hiagent", "softwareFactory", "development", "governance"]; class App extends Component { constructor(props) { @@ -204,17 +217,17 @@ class App extends Component { const login = cookie.load("login"); let path = this.props.history.location.pathname; - if(login && (path === "/login" || path === "/register" || path === "/resetPassword" || path.indexOf("/bindlogin") >-1 )){ + if (login && (path === "/login" || path === "/register" || path === "/resetPassword" || path.indexOf("/bindlogin") > -1)) { this.props.history.push(`/${login}`); } // 添加路由监听,决定组织还是个人 - this.unlisten = this.props.history.listen((location,action) => { + this.unlisten = this.props.history.listen((location, action) => { let newPathname = location.pathname.split('/')[1]; if (location.pathname === '/' && action === 'POP') { // 浏览器回退/前进 this.setState({ pathName: null, pathType: null - }); + }); return; } if (newPathname !== this.state.pathName) { @@ -224,7 +237,7 @@ class App extends Component { } shouldComponentUpdate(nextProps, nextState) { - if(!nextProps.location.pathname==='/'){ + if (!nextProps.location.pathname === '/') { return true; } // 阻止个人与组织切换时(组件渲染)请求导致的404 @@ -246,7 +259,7 @@ class App extends Component { }) } }); - }else{ + } else { this.setState({ pathType: pathname, pathName: pathname, @@ -354,166 +367,186 @@ class App extends Component { render() { const { pathType, pathName, mygetHelmetapi } = this.state; - + return ( this.Modifyloginvalue()}> {/* */} {/* {!pathName || (pathName && pathName.toLowerCase() !== 'glcc') ? : } */} - {pathName && pathName.toLowerCase() === 'glcc' && } + {pathName && pathName.toLowerCase() === 'glcc' && } {/* */} { - pathType ? - - {/* iframe页面 */} - (