diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index fe19c2c5d..3907f0dda 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -302,13 +302,24 @@ class Detail extends Component { if (this.props.defaultDetail) { projectdata = this.props.defaultDetail } else { - const res = await getProjectDetailFunc(owner, projectsId, !window.location.host); - if (res.status === 200) { - projectdata = res.data + this.setState({ + firstSync: false, + secondSync: false, + mirror_status:0 + }) + this.getBanner(this.props.projectMenu) + let projectdata + if (this.props.defaultDetail) { + projectdata = this.props.defaultDetail + } else { + const res = await getProjectDetailFunc(owner, projectsId, !window.location.host); + if (res.status === 200) { + projectdata = res.data + } + } + if (projectdata) { + this.getDetail(projectdata) } - } - if (projectdata) { - this.getDetail(projectdata) } } } diff --git a/src/glcc/api.js b/src/glcc/api.js index 7b25151c8..bfce5cc17 100644 --- a/src/glcc/api.js +++ b/src/glcc/api.js @@ -4,6 +4,9 @@ import fetch from './fetch'; export const currentRound = 3; export const rewardMoney = "现金奖励" export const rewardSettingRound = 3; +export const yearByRound = { + 3: 2024 +} // 获取当前用户项目报名信息(项目、课题) export function getUserApplyInfo(params) { diff --git a/src/glcc/apply/editInfo.jsx b/src/glcc/apply/editInfo.jsx index 4c1ea722a..c62fca6f7 100644 --- a/src/glcc/apply/editInfo.jsx +++ b/src/glcc/apply/editInfo.jsx @@ -1,7 +1,7 @@ import React , { useCallback, useEffect , useState } from 'react'; import { Button, Form, Input, Select, Upload, message, Popconfirm, Checkbox, Icon, Tooltip } from 'antd'; import {getUploadActionUrl} from 'educoder'; -import {applyGlcc, findStudentTaskByTaskId, updateApplyGlcc} from '../api'; +import {applyGlcc, currentRound, findStudentTaskByTaskId, updateApplyGlcc} from '../api'; import TextArea from 'antd/lib/input/TextArea'; import { main_site_url } from '../fetch'; import TaskApply from './taskApply'; @@ -10,7 +10,7 @@ import { FlexAJ } from '../../forge/Component/layout'; const Option = Select.Option; // 编辑项目、课题报名信息 function EditRepoApplyInfo(props) { - const {form, applyInfo, current_user, round, cateList, setReload, isAddRepo, setIsAddRepo, setIsEdit, setEditRepoCount, rewardList} = props; + const {form, applyInfo, current_user, cateList, setReload, isAddRepo, setIsAddRepo, setIsEdit, setEditRepoCount, rewardList} = props; const phonereg = /(^|\s*\+?0?0?86|\D)(1\d{2})[-\s]{0,3}(\d{4})[-\s]{0,3}(\d{4})(?=\D|$)/ const emailreg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/ const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll, getFieldValue, resetFields } = form; @@ -99,15 +99,16 @@ function EditRepoApplyInfo(props) { tutorAddress: values[`tutorAddress${item}`], taskDesc: values[`taskDesc${item}`], tutorPhone: values[`tutorPhone${item}`], - round + round: currentRound }) }) const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, contactMail, joinCooperativeCommunity=false} = values; const params ={ - projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, round, contactMail, joinCooperativeCommunity, + projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, contactMail, joinCooperativeCommunity, projectLogoId: values.logo.file.response.id+"", userId: current_user.user_id, - userName: current_user.username + userName: current_user.username, + round: currentRound } setLoading(true); if(applyInfo){ diff --git a/src/glcc/apply/index.jsx b/src/glcc/apply/index.jsx index 118c85486..2e9896bfd 100644 --- a/src/glcc/apply/index.jsx +++ b/src/glcc/apply/index.jsx @@ -10,7 +10,7 @@ import './index.scss'; import { FlexAJ } from '../../forge/Component/layout'; // 项目、课题报名 function Apply(props) { - const {current_user, round, glccSettings} = props; + const {current_user, glccSettings} = props; const [reload, setReload] = useState(undefined); const [cateList, setCateList] = useState([]); const [userApplyInfo, setUserApplyInfo] = useState([]); @@ -46,7 +46,7 @@ function Apply(props) { useEffect(()=>{ // 获取当前用户报名信息 - current_user && round && getUserApplyInfo({userId: current_user.user_id, round}).then(response=>{ + current_user && getUserApplyInfo({userId: current_user.user_id, round: currentRound}).then(response=>{ if(response && response.message === "success"){ setUserApplyInfo(response.data); } @@ -95,9 +95,9 @@ function Apply(props) { {userApplyInfo.length > 0 && 添加项目} {userApplyInfo.length > 0 &&