From 05f0550def9f3b2a9b88237c6af196430651e64f Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Thu, 19 Mar 2020 14:30:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=8D=95=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E9=A1=B9=E7=9B=AE=E6=A0=B9=E6=8D=AEid=E5=AF=BB?= =?UTF-8?q?=E6=89=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 6660d93..cc4e3dd 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -1,6 +1,6 @@ class IssuesController < ApplicationController before_action :require_login, except: [:index, :show] - before_action :find_project + before_action :find_project_issue before_action :set_project_and_user before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue] before_action :check_issue_permission, except: [:index, :show, :index_chosen] @@ -430,4 +430,10 @@ class IssuesController < ApplicationController end all_branches end + + def find_project_issue + project_id = params[:id] + @project = Project.find_by(id: project_id) + render_not_found("未找到’#{project}’相关的项目") unless @project + end end