From 4c6a2d596d6eb9c0012fcc206f16ad4b9db7f959 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 7 Sep 2019 11:01:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=89=88VNC=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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)