From da8fa9390464f71f29783d58c758c0e8c59449c1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 19 Nov 2019 14:31:17 +0800 Subject: [PATCH] 1 --- app/controllers/hack_user_lastest_codes_controller.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index bbe94233f..2123d4a0b 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -6,7 +6,7 @@ class HackUserLastestCodesController < ApplicationController before_action :require_manager_identity, only: [:update_code] def show - @my_hack.update_attribute(:status, 0) if @my_hack.status == 1 + @my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1 end def update_code @@ -33,8 +33,11 @@ class HackUserLastestCodesController < ApplicationController # 提交结果显示 def result - return if @my_hack.status == 1 - + if @my_hack.submit_status == 1 + render json: {status:0, message: "正在评测中"} + else + @my_hack.hack_user_lastest_code + end end # 接收中间件返回结果接口