|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
class HackUserLastestCodesController < ApplicationController
|
|
|
|
|
before_action :require_login, except: [:listen_result]
|
|
|
|
|
before_action :find_user_hack, only: [:show, :code_debug, :code_submit, :update_code, :listen_result]
|
|
|
|
|
before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :listen_result, :result]
|
|
|
|
|
before_action :update_user_hack_status, only: [:code_debug, :code_submit]
|
|
|
|
|
before_action :require_auth_identity, only: [:update_code]
|
|
|
|
|
before_action :require_manager_identity, only: [:update_code]
|
|
|
|
@ -33,6 +33,7 @@ class HackUserLastestCodesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
# 提交结果显示
|
|
|
|
|
def result
|
|
|
|
|
return if @my_hack.status == 1
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -72,7 +73,7 @@ class HackUserLastestCodesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
def find_user_hack
|
|
|
|
|
def find_my_hack
|
|
|
|
|
@my_hack = HackUserLastestCode.find_by(identifier: params[:identifier])
|
|
|
|
|
@hack = @my_hack.hack
|
|
|
|
|
end
|
|
|
|
|