代码加密功能

dev_daiao
daiao 5 years ago
parent 292c3777d1
commit df6d956bdc

@ -51,9 +51,9 @@ class HackUserLastestCodesController < ApplicationController
# debug 与submit 公用的参数
ds_params = {input: testCase['input'], output: testCase['output'], hack_id: @hack.id,
user_id: @my_hack.user_id, error_line: error_line, status: ojEvaResult['status'],
error_msg: ojEvaResult['outPut'], execute_time: ojEvaResult['executeTime'],
execute_memory: ojEvaResult['executeMem']}
code: ojEvaResult['codeFileContent'], user_id: @my_hack.user_id, error_line: error_line,
status: ojEvaResult['status'], error_msg: ojEvaResult['outPut'],
execute_time: ojEvaResult['executeTime'], execute_memory: ojEvaResult['executeMem']}
ActiveRecord::Base.transaction do
# debug模式与submit模式
if ojEvaResult['execMode'] == "debug"
@ -64,6 +64,7 @@ class HackUserLastestCodesController < ApplicationController
# 评测完成后,还原评测中的状态
@my_hack.update_attribute(:submit_status, 0)
end
render_ok
rescue Exception => e
logger.error("#########listen_result: #{e.message}")
end

@ -24,9 +24,9 @@ class Hack < ApplicationRecord
def code
if hack_codes.count == 1
hack_codes.first.code
tran_base64_decode64(hack_codes.first.code)
else
hack_codes.pluck(:code)
tran_base64_decode64(hack_codes.pluck(:code))
end
end

Loading…
Cancel
Save