瀏覽代碼

'修改冲突'

Ethan 6 年之前
父節點
當前提交
7b5b6aec11

+ 2 - 1
application/admin/controller/Material.php

@@ -181,7 +181,6 @@ class Material extends Base
     public function upMaterial()
     {
         if(request()->isAjax()) {
-
             $file = request()->file('file');
             if (!empty($file)) {
 
@@ -209,6 +208,8 @@ class Material extends Base
                     // 上传失败获取错误信息
                     return json(['code' => -1, 'data' => '', 'msg' => $file->getError()]);
                 }
+            } else {
+                return json(['code' => -2, 'data' => '', 'msg' => '文件超过0.5M'] );
             }
         }
     }

+ 1 - 1
application/admin/controller/Report.php

@@ -109,7 +109,7 @@ class Report extends Base
 
         $allChat = 0;  // 会话总数.
         $allService = 0;  // 消息总数.
-        $allQueue = 0;  // 消息总数.
+        $allQueue = 0;  // 排队总数.
         foreach ($chatData as $v) {
             $allChat += $v;
         }

+ 17 - 0
application/admin/controller/Users.php

@@ -249,6 +249,21 @@ class Users extends Base
 
             $file = request()->file('file');
             if (!empty($file)) {
+
+                $fileInfo = $file->getInfo();
+                //return $fileInfo;
+                if ($fileInfo['size'] > 1024 * 512 * 2) {
+                    // 上传失败获取错误信息.
+                    return json(['code' => -2, 'data' => '', 'msg' => '文件超过0.5M'] );
+                }
+
+                //检测图片格式
+                $ext = explode('/', $fileInfo['type']);
+                $ext = array_pop($ext);
+                $extArr = explode('|', 'jpg|png|gif|jpeg');
+                if(!in_array($ext, $extArr)){
+                    return json(['code' => -3, 'data' => '', 'msg' => '只能上传jpg|png|gif|jpeg的文件']);
+                }
                 // 移动到框架应用根目录/public/uploads/ 目录下
                 $info = $file->move(ROOT_PATH . 'public' . DS . 'uploads');
                 if ($info) {
@@ -258,6 +273,8 @@ class Users extends Base
                     // 上传失败获取错误信息
                     return json(['code' => -1, 'data' => '', 'msg' => $file->getError()]);
                 }
+            } else {
+                return json(['code' => -2, 'data' => '', 'msg' => '文件超过0.5M'] );
             }
         }
     }

+ 1 - 1
vendor/GatewayWorker_windows/Applications/whisper/Events.php

@@ -600,7 +600,7 @@ class Events
         $groupMax = self::$global->systemconfig['maxWait'];
         $noworders = self::getUselistData($group);
         if ($noworders && count($noworders) >= intval($groupMax['systemconfig_data'])) {
-            Gateway::sendToClient($client_id, json_encode(['message_type' => 'notice', 'content' => '组排队人数超过上限,请稍后连线。'], 256));
+            Gateway::sendToClient($client_id, json_encode(['message_type' => 'notice', 'content' => '组排队人数超过上限,请稍后连线。'], 256));
             return;
         }
 

+ 5 - 5
vendor/GatewayWorker_windows/Applications/whisper/start_gateway.php

@@ -37,7 +37,7 @@ $gateway->registerAddress = '127.0.0.1:1238';
 
 
 // 心跳间隔
-$gateway->pingInterval = 5;
+$gateway->pingInterval = 20;
 $gateway->pingNotResponseLimit = 2;
 $gateway->pingData = '{"message_type":"ping"}';
 
@@ -49,16 +49,16 @@ Worker::$stdoutFile = $tmpPath . '/stdout_' . date("Y-m-d") . '.log';
 // 当客户端连接上来时,设置连接的onWebSocketConnect,即在websocket握手时的回调
 $gateway->onConnect = function ($connection) {
     $connection->onWebSocketConnect = function ($connection, $http_header) {
-        $apiToken = md5('Customer-Service' . strtotime(date('Y-m-d')) . $_SERVER['HTTP_ORIGIN']);
+        //$apiToken = md5(strtolower('Customer-Service' . strtotime(date('Y-m-d')) . $_SERVER['HTTP_ORIGIN']));
+        $apiToken = md5(strtolower('Customer-Service' . $_SERVER['HTTP_ORIGIN']));
         //echo $apiToken."/".$_GET['apiToken'];
         $_SESSION['userAgent'] = $_SERVER['HTTP_USER_AGENT'];
-        $_SESSION['origin'] = $_SERVER['HTTP_ORIGIN'];
+        $_SESSION['origin'] = $_SERVER['HTTP_ORIGIN'];//
         $getToken = isset($_GET['apiToken']) ? $_GET['apiToken'] : '';
 
-
         if ($getToken !== $apiToken) {
             //$connection->close();
-            // return;
+            //return;
         }
         $_SESSION['remotip'] = $connection->getRemoteIp();
         $_SESSION['remotport'] = $connection->getRemotePort();