diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index f9623344b..120387361 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -119,7 +119,7 @@ class GamesController < ApplicationController def file_update @g = Gitlab.client - content = params[:content].strip + content = params[:content].try(:strip) code_file = @g.edit_file(@myshixun.gpid, :content => params[:content], :file_path => @path, :branch_name => @rev, :commit_message => "shixun exec") unless code_file.blank? render :json => {:success => "success"} diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index 97f89c4ad..10926f530 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -1,9 +1,7 @@ -<% if @game.status == 2 %> -
- 加载上次通过的代码 +
"> + 加载上次通过的代码
-<% end %>
评测
@@ -135,8 +133,9 @@ // 传递具体屏幕的宽高,实现不同浏览器与不同分辨率都能撑满屏幕 pop_box_new2(htmlvalue, window.innerWidth, window.innerHeight); } - var html = "评测"; - $("#code_test").html(html); + var html = "评测"; + $("#code_test").html(html); // 恢复评测 + $("#reset_code_to_bengin").show(); // 显示加载上次通过的代码 } // 访问60次,即120s后后台还未改变状态即执行 if(i == 60){