glcc 报名两个课题+课题项目url屏蔽

This commit is contained in:
谢思 2023-06-01 20:12:58 +08:00
parent 4b5e155fbf
commit 76d943ca02
2 changed files with 9 additions and 6 deletions

View File

@ -172,9 +172,9 @@ const Glcc = (propsF) => {
//
if(lockedTaskName){
message.error(`由于你已入选 ${lockedTaskName} 课题,无法申请其他课题`);
}else if(applyTaskId && Object.keys(applyTaskId).length >= 3){
//
message.error('最多只能同时报名个课题');
}else if(applyTaskId && Object.keys(applyTaskId).length >= 2){
//
message.error('最多只能同时报名个课题');
}else{
//
window.location.href=`/glcc/student/apply/${id}`;
@ -225,7 +225,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc/:id/projects"
render={(props) => (
<Project period={period} round={round} {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
<Project repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
)}
></Route>
@ -233,7 +233,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc/:id/subjects"
render={(props) => (
<Project period={period} round={round} {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask}/>
<Project repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask}/>
)}
></Route>

View File

@ -20,8 +20,11 @@ const TaskList = Loadable({
});
function Project(propsF) {
const {location, match:{params:{id}}} = propsF;
const {location, match:{params:{id}}, repoPublic, history} = propsF;
const {pathname} = location;
if(id==="2023" && !repoPublic){
history.go(-1);
}
useEffect(()=>{
window.scrollTo(0, 0);
},[])