diff --git a/app/models/myshixun.rb b/app/models/myshixun.rb index 774caad9..b5e9df62 100644 --- a/app/models/myshixun.rb +++ b/app/models/myshixun.rb @@ -15,7 +15,8 @@ class Myshixun < ActiveRecord::Base belongs_to :user validates_uniqueness_of :shixun_id, :scope => :user_id, :message => "error" # validates :shixun_id, :uniqueness => {:scope => :user_id, :message => "不能被重复开启"} - scope :min, lambda { select([:id, :shixun_id, :identifier, :gpid, :status, :user_id, :commit_id, :modify_time, :reset_time, :system_tip]) } + scope :min, lambda { select([:id, :shixun_id, :identifier, :gpid, :status, :user_id, :commit_id, :modify_time, :reset_time, + :system_tip, :gpid]) } scope :finished, lambda{where(status: 1)} def output_times diff --git a/app/services/games_service.rb b/app/services/games_service.rb index 630d0848..f09e2dcf 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -89,14 +89,17 @@ class GamesService end url = service_host +":#{res['port']}/vnc_lite.html" Rails.logger.info("66666666sssssss#{url}") - container = container.merge(:vnc_url => url, :test => "666") + container = container.merge(:vnc_url => url) Rails.logger.info("777777666sssssss#{container}") rescue Exception => e Rails.logger.error(e.message) end - end + if myshixun_manager + zip_path = Gitlab.endpoint.to_s + "/projects/" + myshixun.gpid.to_s + "/repository/archive?&private_token=" + Gitlab.private_token.to_s + container = container.merge(:zip_path => zip_path) + end # 区分选择题和编程题,st:0编程题; if st == 0