From e7a197bad3ea118b19f7d51e9f55bd9e59200c61 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 13 Aug 2019 17:28:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 64ea7f50d..9b28d9a10 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -282,7 +282,7 @@ class SubjectsController < ApplicationController # 删除实训 # DELETE: /api/subejcts/:id/delete_member def delete_member - tip_exception(403, "没权限操作") unless current_user.creator_of_subject?(@subject) + tip_exception(403, "没权限操作") unless current_user.manager_of_subject?(@subject) tip_exception('用户id不能为空') if params[:user_id].blank? user = @subject.subject_members.where(:user_id => params[:user_id], :role => 2).first tip_exception("管理员用户不允许删除,或用户不存在") if user.blank? From 8c3d13dccf1abeb3adb985985fc185acc30bb4ae Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 13 Aug 2019 17:41:08 +0800 Subject: [PATCH 2/2] this.props.history.push('/paths') --- public/react/src/modules/paths/PathDetail/PathDetailIndex.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 3c17a98f1..fd45f13e6 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -252,6 +252,10 @@ class PathDetailIndex extends Component{ let param={user_id:user_id}; axios.delete(url,{data:param}).then((response) => { if(response.data.status===1){ + if (this.props.current_user.user_id == user_id) { + this.props.history.push('/paths') + return; + } this.props.showNotification(response.data.message) this.setState({ Modalstype:false,