Parcourir la source

修复获取ws地址bug

sugar1569 il y a 4 ans
Parent
commit
aafde99ccf
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      crmeb/app/common.php

+ 1 - 2
crmeb/app/common.php

@@ -24,7 +24,7 @@ if (!function_exists('getWorkerManUrl')) {
      */
      */
     function getWorkerManUrl()
     function getWorkerManUrl()
     {
     {
-        $ws = $_SERVER['HTTPS'] == 'on' ? 'wss://' : 'ws://';
+        $ws = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']) == 'on' ? 'wss://' : 'ws://';
         $host = $_SERVER['HTTP_HOST'];
         $host = $_SERVER['HTTP_HOST'];
         $data['admin'] = $ws . $host . '/notice';
         $data['admin'] = $ws . $host . '/notice';
         $data['channel'] = $ws . $host . '/msg';
         $data['channel'] = $ws . $host . '/msg';
@@ -32,7 +32,6 @@ if (!function_exists('getWorkerManUrl')) {
     }
     }
 }
 }
 
 
-
 if (!function_exists('exception')) {
 if (!function_exists('exception')) {
     /**
     /**
      * 抛出异常处理
      * 抛出异常处理