diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx
index 96ede7536..ab4a17cc2 100644
--- a/src/glcc/index.jsx
+++ b/src/glcc/index.jsx
@@ -11,6 +11,7 @@ import "./index.scss";
import Loadable from "react-loadable";
import Loading from "../Loading";
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
+import { useState } from "react";
// 任务管理审核
@@ -28,6 +29,12 @@ const Help = Loadable({
loader: () => import("./help"),
loading: Loading,
});
+// 任务管理审核
+const Student = Loadable({
+ loader: () => import("./student"),
+ loading: Loading,
+});
+
// 开源夏令营项目、课题列表页面
const Project = Loadable({
loader: () => import("./project"),
@@ -37,10 +44,19 @@ const Project = Loadable({
const Glcc = (propsF) => {
// 判断时间是否在开源夏令营报名时间内(4月15日~5月20日)
const isGlccApplyDate = Date.parse(new Date()) < 1653062400000;
+ // 刷新用户课题报名信息
+ const [studentInfoReset, setStudentInfoReset] = useState(undefined);
return (
+ {/* 学生报名 */}
+ (
+
+ )}
+ >
{/* 开源夏令营报名页面 */}
{
(
-
+
)}
>
{/* 首页 */}
diff --git a/src/glcc/project/index.jsx b/src/glcc/project/index.jsx
index bfdd7823a..7b1641189 100644
--- a/src/glcc/project/index.jsx
+++ b/src/glcc/project/index.jsx
@@ -20,7 +20,7 @@ const TaskList = Loadable({
});
function Project(propsF) {
- const {location, current_user, showLoginDialog} = propsF;
+ const {location, current_user, showLoginDialog, studentInfoReset, setStudentInfoReset} = propsF;
const {pathname} = location;
const isStudentApplyDate = Date.parse(new Date()) > 1653494400000 && Date.parse(new Date()) < 1656086400000;
const studentApplyEnd = Date.parse(new Date()) > 1656086400000;
@@ -29,8 +29,6 @@ function Project(propsF) {
// 用户已报名课题id数组
const [applyTaskId, setApplyTaskId] = useState({});
- // 刷新用户课题报名信息
- const [studentInfoReset, setStudentInfoReset] = useState(undefined);
useEffect(()=>{
// 获取用户课题报名信息current_user user_id
diff --git a/src/glcc/project/taskList/index.jsx b/src/glcc/project/taskList/index.jsx
index 999f00bef..c5d5d7c1b 100644
--- a/src/glcc/project/taskList/index.jsx
+++ b/src/glcc/project/taskList/index.jsx
@@ -133,7 +133,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
ids.includes(item.id.toString()) && toFirst(data, index);
})
setData(response.data.rows);
- setTotal(response.data.total)
+ setTotal(response.data.total);
}
setLoading(false);
})
diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx
index 115f9245b..698ac8ab8 100644
--- a/src/glcc/student/index.jsx
+++ b/src/glcc/student/index.jsx
@@ -21,7 +21,7 @@ const gradeList = [
{ id: '研二', name: '研二' },
{ id: '研三', name: '研三' }];
function Apply(props) {
- const { form, current_user, showNotification, match } = props;
+ const { form, current_user, showNotification, match, setStudentInfoReset } = props;
const taskId = Number(match.params.taskId);
// 可用于开发时不同账号报名
// current_user && (current_user.user_id = 6)
@@ -190,6 +190,7 @@ function Apply(props) {
studentApplyEdit(params).then(response => {
if (response && response.message === "success") {
showNotification("修改信息成功");
+ setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
}
@@ -198,6 +199,7 @@ function Apply(props) {
studentApply(params).then(response => {
if (response && response.message === "success") {
showNotification("报名成功");
+ setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
}