diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index ac72577e0..916f09430 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -67,13 +67,19 @@ class GamesController < ApplicationController uri = "#{shixun_tomcat}/bridge/vnc/getvnc" params = {tpiID: @myshixun.id, :containers => "#{Base64.urlsafe_encode64(shixun_container_limit(@shixun))}"} res = uri_post uri, params + logger.info("###############---- ") if res && res['code'].to_i != 0 raise("实训云平台繁忙(繁忙等级:99)") end - # 无域名版本 - #@vnc_url = "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless" - # 有域名版本 - @vnc_url = "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless" + + if request.subdomain == "pre-newweb" + # 无域名版本 + @vnc_url = "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless" + else + # 有域名版本 + @vnc_url = "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless" + end + @vnc_evaluate = @shixun.vnc_evaluate rescue Exception => e Rails.logger.error(e.message)