diff --git a/public/react/src/modules/courses/members/ChangeRolePop.js b/public/react/src/modules/courses/members/ChangeRolePop.js index 896360a40..7f55910bf 100644 --- a/public/react/src/modules/courses/members/ChangeRolePop.js +++ b/public/react/src/modules/courses/members/ChangeRolePop.js @@ -6,7 +6,7 @@ import axios from 'axios' /** 角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生 */ -function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSuccess, showNotification }) { +function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSuccess, showNotification, getUserId, fetchUser }) { const [checkBoxRoles, setCheckBoxRoles] = useState(member_roles) useEffect(() => { setCheckBoxRoles(member_roles) @@ -43,7 +43,12 @@ function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSucces if (response.data.status == 0) { showNotification('保存成功') onChangeRoleSuccess() - trigger('updatabanner') + + if (fetchUser && record.user_id == getUserId) { + fetchUser() + trigger('updatabanner') + } + } console.log(response) } diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index e3859345a..626a76baf 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -155,6 +155,8 @@ const buildColumns = (that,isParent) => { member_roles={record.member_roles} onChangeRoleSuccess={that.onChangeRoleSuccess} showNotification={that.props.showNotification} + getUserId={that.props.isUserid} + fetchUser={that.props.fetchUser} > ) diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index 72b667300..74271ea5a 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -165,6 +165,9 @@ function buildColumns(that) { member_roles={record.member_roles} onChangeRoleSuccess={that.onChangeRoleSuccess} showNotification={that.props.showNotification} + getUserId={that.props.isUserid} + fetchUser={that.props.fetchUser} + > {/*