From ae764f96069edb1f0f89d092087734e4c7a8f98a Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 10 Oct 2019 17:14:28 +0800 Subject: [PATCH 1/4] window.location.reload() --- public/react/src/modules/courses/members/modal/AddAdminModal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/courses/members/modal/AddAdminModal.js b/public/react/src/modules/courses/members/modal/AddAdminModal.js index 5ca1867e7..80ad75f66 100644 --- a/public/react/src/modules/courses/members/modal/AddAdminModal.js +++ b/public/react/src/modules/courses/members/modal/AddAdminModal.js @@ -95,6 +95,7 @@ class AddAdminModal extends Component{ user_id: this.state.radioBoxValue.user_id }).then((result)=>{ if(result.data.status==0){ + window.location.reload() this.props.showNotification('操作成功。') // this.fetchAll() this.setVisible(false) From 7f09f745c36bbdc6021bd60412fea60744124016 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 10 Oct 2019 17:21:10 +0800 Subject: [PATCH 2/4] =?UTF-8?q?this.props.showNotification('=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=88=90=E5=8A=9F=E3=80=82')?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/members/modal/AddAdminModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/members/modal/AddAdminModal.js b/public/react/src/modules/courses/members/modal/AddAdminModal.js index 80ad75f66..a1ec2e8f0 100644 --- a/public/react/src/modules/courses/members/modal/AddAdminModal.js +++ b/public/react/src/modules/courses/members/modal/AddAdminModal.js @@ -95,8 +95,8 @@ class AddAdminModal extends Component{ user_id: this.state.radioBoxValue.user_id }).then((result)=>{ if(result.data.status==0){ - window.location.reload() this.props.showNotification('操作成功。') + window.location.reload() // this.fetchAll() this.setVisible(false) this.props.changeAdminSuccess && this.props.changeAdminSuccess() From a86c3478052784e4ef3ebe52a822054663acbfdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 10 Oct 2019 17:30:10 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/Listofworksstudentone.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 73070497b..0cd04f5d5 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -3344,6 +3344,7 @@ class Listofworksstudentone extends Component { ` .edu-position-hide li a:hover { background: #F0F0F0; + color: #05101A; } ` } From abb5ec8cfd871d5754cd2c3378556c7ad9e65a23 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 10 Oct 2019 17:45:08 +0800 Subject: [PATCH 4/4] if (this.props.isCourseAdmin()) { --- .../src/modules/courses/members/modal/AddAdminModal.js | 4 +++- public/react/src/modules/tpm/TPMIndexHOC.js | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/members/modal/AddAdminModal.js b/public/react/src/modules/courses/members/modal/AddAdminModal.js index a1ec2e8f0..5cbf0c204 100644 --- a/public/react/src/modules/courses/members/modal/AddAdminModal.js +++ b/public/react/src/modules/courses/members/modal/AddAdminModal.js @@ -96,7 +96,9 @@ class AddAdminModal extends Component{ }).then((result)=>{ if(result.data.status==0){ this.props.showNotification('操作成功。') - window.location.reload() + if (this.props.isCourseAdmin()) { + window.location.reload() + } // this.fetchAll() this.setVisible(false) this.props.changeAdminSuccess && this.props.changeAdminSuccess() diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index c39042308..dd4572bcc 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -222,7 +222,7 @@ export function TPMIndexHOC(WrappedComponent) { # 课程权限判断 ADMIN = 0 # 超级管理员 BUSINESS = 1 # 运营人员 - CREATOR = 2 # 课程创建者 + CREATOR = 2 # 课程创建者 课堂管理员 PROFESSOR = 3 # 课程老师 ASSISTANT_PROFESSOR = 4 # 课程助教 STUDENT = 5 # 学生 @@ -233,6 +233,9 @@ export function TPMIndexHOC(WrappedComponent) { isSuperAdmin = () => { // return false return this.state.coursedata&&this.state.coursedata.course_identity === 0 + } + isCourseAdmin = () => { + return this.state.coursedata&&this.state.coursedata.course_identity === 2 } //超管、运维0-1 isClassManagement = () => { @@ -537,6 +540,8 @@ export function TPMIndexHOC(WrappedComponent) { isSuperAdmin:this.isSuperAdmin, isAdminOrCreator:this.isAdminOrCreator, isClassManagement:this.isClassManagement, + isCourseAdmin:this.isCourseAdmin, + isAdmin: this.isAdmin, isAdminOrTeacher: this.isAdminOrTeacher, isStudent: this.isStudent,