|
|
@ -6,7 +6,7 @@ import axios from 'axios'
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生
|
|
|
|
角色数组, 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)
|
|
|
|
const [checkBoxRoles, setCheckBoxRoles] = useState(member_roles)
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
setCheckBoxRoles(member_roles)
|
|
|
|
setCheckBoxRoles(member_roles)
|
|
|
@ -43,7 +43,12 @@ function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSucces
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
showNotification('保存成功')
|
|
|
|
showNotification('保存成功')
|
|
|
|
onChangeRoleSuccess()
|
|
|
|
onChangeRoleSuccess()
|
|
|
|
trigger('updatabanner')
|
|
|
|
|
|
|
|
|
|
|
|
if (fetchUser && record.user_id == getUserId) {
|
|
|
|
|
|
|
|
fetchUser()
|
|
|
|
|
|
|
|
trigger('updatabanner')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log(response)
|
|
|
|
console.log(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|