From 7b11040ee8c7f3fd4bf1ed6a5a8aba4f33593692 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 31 Jan 2020 18:42:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/colleges_controller.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index ee7b9c014..00623041e 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -136,22 +136,16 @@ class CollegesController < ApplicationController private - def require_login - return if User.current.logged? - - redirect_to "/login?back_url=#{CGI::escape(request.fullpath)}" - end - def check_college_present! return if current_college.present? - redirect_to '/404' + tip_exception(404, "") end def check_manage_permission! return if can_manage_college? - redirect_to '/403' + tip_exception(403, "") end def can_manage_college? @@ -160,7 +154,7 @@ class CollegesController < ApplicationController return true if current_user.is_teacher? && current_user.school_id == current_school.id # 学校老师 # return true if current_school.customers.exists? && current_user.partner&.partner_customers&.exists?(customer_id: current_school.customer_id) - false + tip_exception(403, "") end def current_school