修改项目及课题路由

This commit is contained in:
何童崇 2022-05-26 14:57:55 +08:00
parent 84f51cd3ad
commit d353f2a21e
6 changed files with 20 additions and 12 deletions

View File

@ -33,7 +33,7 @@ export default (props) => {
if(!studentApplyStart){
showNotification("不在报名时间报名开始时间为5月26日");
}else{
window.location.href="/glcc/student/2";
window.location.href="/glcc/subjects";
}
}

View File

@ -32,7 +32,7 @@ function Lightspot(props) {
if(!studentApplyStart){
showNotification("不在报名时间报名开始时间为5月26日");
}else{
window.location.href="/glcc/student/2";
window.location.href="/glcc/subjects";
}
}

View File

@ -109,7 +109,15 @@ const Glcc = (propsF) => {
></Route>
{/* 项目/课题列表 */}
<Route
path="/glcc/student"
path="/glcc/projects"
render={(props) => (
<Project {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset}/>
)}
></Route>
{/* 课题列表 */}
<Route
path="/glcc/subjects"
render={(props) => (
<Project {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset}/>
)}

View File

@ -30,8 +30,8 @@ function Project(propsF) {
<div className="glcc_project">
<img className="glcc-banner" src={banner} alt=''></img>
<div className='head'>
<Link to="/glcc/student/2" className={!pathname.endsWith('/1') ? 'active' : ''}>课题列表</Link>
<Link to="/glcc/student/1" className={pathname.endsWith('/1') ? 'active' : ''}>项目列表</Link>
<Link to="/glcc/subjects" className={!pathname.endsWith('projects') ? 'active' : ''}>课题列表</Link>
<Link to="/glcc/projects" className={pathname.endsWith('projects') ? 'active' : ''}>项目列表</Link>
</div>
<div className='gobackBox'>
<a href='/glcc'>开源夏令营 / </a>
@ -40,13 +40,13 @@ function Project(propsF) {
<Spin spinning={false}>
<Switch {...propsF}>
<Route
path="/glcc/student/1"
path="/glcc/projects"
render={(props) => (
<ProjectList applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd}/>
)}
></Route>
<Route
path="/glcc/student/2"
path="/glcc/subjects"
render={(props) => (
<TaskList applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd}/>
)}

View File

@ -44,7 +44,7 @@ function TaskDetail(props) {
<div className="detailBox">
<div className='goBackBox'>
<a href='/glcc'>开源夏令营 / </a>
<a href='/glcc/student/2'>课题及项目列表 / </a>
<a href='/glcc/subjects'>课题及项目列表 / </a>
课题详情
</div>
</div>

View File

@ -58,7 +58,7 @@ function Apply(props) {
if (new Date().getTime() < new Date('2022-05-26').getTime()) {
//
window.location.href = "/glcc/student/2";
window.location.href = "/glcc/subjects";
} else if (current_user && current_user.login) {
} else {
@ -193,7 +193,7 @@ function Apply(props) {
setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
history.push(`/glcc/student/2`)
history.push(`/glcc/subjects`)
}
});
} else {
@ -203,7 +203,7 @@ function Apply(props) {
setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
history.push(`/glcc/student/2`)
history.push(`/glcc/subjects`)
}
});
}
@ -351,7 +351,7 @@ function Apply(props) {
<div className='apply'>
<Breadcrumb className='glcc_breadcrumb font-16'>
<Breadcrumb.Item><Link to="/glcc">开源夏令营</Link></Breadcrumb.Item>
<Breadcrumb.Item><Link to="/glcc/student/2">课题及项目列表</Link></Breadcrumb.Item>
<Breadcrumb.Item><Link to="/glcc/subjects">课题及项目列表</Link></Breadcrumb.Item>
<Breadcrumb.Item style={{ color: '#202D40' }}>学生报名</Breadcrumb.Item>
</Breadcrumb>