mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 13:45:44 +08:00
新增:代码溯源设置cookie用于访问
This commit is contained in:
@@ -3,6 +3,7 @@ class Traces::ProjectsController < Traces::BaseController
|
|||||||
|
|
||||||
before_action :require_login
|
before_action :require_login
|
||||||
before_action :load_project
|
before_action :load_project
|
||||||
|
before_action :set_trace_token_to_cookie
|
||||||
before_action :authorizate_user_can_edit_project!, except: [:task_results]
|
before_action :authorizate_user_can_edit_project!, except: [:task_results]
|
||||||
|
|
||||||
def tasks
|
def tasks
|
||||||
@@ -86,4 +87,8 @@ class Traces::ProjectsController < Traces::BaseController
|
|||||||
puts exception.message
|
puts exception.message
|
||||||
normal_status(-1, exception.message)
|
normal_status(-1, exception.message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_trace_token_to_cookie
|
||||||
|
cookies[:vue_admin_template_token] = current_user&.trace_token
|
||||||
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user