|
|
@ -1,6 +1,6 @@
|
|
|
|
class IssuesController < ApplicationController
|
|
|
|
class IssuesController < ApplicationController
|
|
|
|
before_action :require_login, except: [:index, :show]
|
|
|
|
before_action :require_login, except: [:index, :show]
|
|
|
|
# before_action :find_project
|
|
|
|
before_action :find_project
|
|
|
|
before_action :set_project_and_user
|
|
|
|
before_action :set_project_and_user
|
|
|
|
before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue]
|
|
|
|
before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue]
|
|
|
|
before_action :check_issue_permission, except: [:index, :show, :index_chosen]
|
|
|
|
before_action :check_issue_permission, except: [:index, :show, :index_chosen]
|
|
|
@ -350,9 +350,9 @@ class IssuesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
private
|
|
|
|
def set_project_and_user
|
|
|
|
def set_project_and_user
|
|
|
|
@project = Project.find_by_identifier(params[:project_id]) || (Project.find params[:project_id]) || (Project.find params[:id])
|
|
|
|
# @project = Project.find_by_identifier(params[:project_id]) || (Project.find params[:project_id]) || (Project.find params[:id])
|
|
|
|
@user = @project&.owner
|
|
|
|
@user = @project&.owner
|
|
|
|
normal_status(-1, "项目不存在") unless @project.present?
|
|
|
|
# normal_status(-1, "项目不存在") unless @project.present?
|
|
|
|
normal_status(-1, "用户不存在") unless @user.present?
|
|
|
|
normal_status(-1, "用户不存在") unless @user.present?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|