diff --git a/src/forge/Main/version/New.jsx b/src/forge/Main/version/New.jsx index 8cfd912d..248c010e 100644 --- a/src/forge/Main/version/New.jsx +++ b/src/forge/Main/version/New.jsx @@ -33,7 +33,7 @@ export default Form.create()( const [fileList, setFileList] = useState(undefined); const [attachment, setAttachment] = useState(undefined); const [options , setOptions] = useState(undefined); - const stable = history && history.location && history.location.state.stable; + const stable = history && history.location && history.location.state&&history.location.state.stable; const { projectsId, versionId , owner } = match.params; useEffect(()=>{ diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx index 06a1c4bc..0656c390 100644 --- a/src/glcc/student/index.jsx +++ b/src/glcc/student/index.jsx @@ -9,7 +9,6 @@ import banner from "../img/banner.png"; import studentSvg from "../img/student.png"; import './index.scss'; import { Link } from 'react-router-dom'; -import { color } from 'echarts/lib/theme/light'; const Option = Select.Option; const gradeList = [ @@ -27,6 +26,8 @@ function Apply(props) { // 可用于开发时不同账号报名 // current_user && (current_user.user_id = 6) // current_user && (current_user.userName = "创新使者") + const isStudentApplyDate = new Date().getTime() > new Date('2022-05-26').getTime() && new Date().getTime() < new Date('2022-06-26').getTime(); + const { getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form; const [imageUrl, setImageUrl] = useState(undefined); const [loading, setLoading] = useState(false); @@ -44,24 +45,24 @@ function Apply(props) { const [allTaskList, setAllTaskList] = useState([]); // 学生报名时间范围内 - const isStudentApplyDate = Date.parse(new Date()) > 1653494400000 && Date.parse(new Date()) < 1656086400000; // 已过学生报名时间 - const studentApplyEnd = Date.parse(new Date()) > 1656086400000; useEffect(() => { // 进入此页面到填写页面 - // setTimeout(()=>{ + setTimeout(()=>{ let clientWidth = document.body.clientWidth; let scrollHeight = 500 * clientWidth / 1920; window.scrollTo(0, scrollHeight); + }); + // window.scrollTo(0, 50); if (!isStudentApplyDate) { // 不在开源夏令营报名时间之内 - window.location.href = "/glcc/student/2"; + // window.location.href = "/glcc/student/2"; } else if (current_user && current_user.login) { } else { - window.location.href = "/login?go_page=/glcc"; + window.location.href = `/login?go_page=/glcc/student/apply/${taskId}`; } }, []) @@ -260,12 +261,11 @@ function Apply(props) { // 自荐书上传 function bookChange(info, i) { if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') { - setLoading(true); + // setLoading(true); if (info.file.status === "done") { changeTaskItem('memoAttachmentId', info.fileList[0].response && info.fileList[0].response.data.id, i) } if (info.file.status === 'removed') { - console.log(1111) changeTaskItem('memoAttachmentId', '', i); } console.log(info.fileList); @@ -276,9 +276,9 @@ function Apply(props) { } } - if (info.file.status === "done" || info.file.status === 'removed') { - setLoading(false); - } + // if (info.file.status === "done" || info.file.status === 'removed') { + // setLoading(false); + // } } // 支持文件下载 @@ -397,7 +397,7 @@ function Apply(props) { '', 'grade', [], - )}