瀏覽代碼

测试socket

lizhen_gitee 1 周之前
父節點
當前提交
55ad3408d0
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 5 1
      app/Http/Controllers/Api/ChatController.php
  2. 1 1
      app/Wen/Utils/GatewayUtils.php

+ 5 - 1
app/Http/Controllers/Api/ChatController.php

@@ -350,7 +350,11 @@ class ChatController extends BaseController
         if($model){
             $websocket_id = GatewayUtils::uid2client_id($oid);
             if($websocket_id){
-                GatewayUtils::success($websocket_id, 5, ['chat_content'=>_mini_emoji($chat_content, true), 'chat_image'=>$chat_image,
+                $mode = 5;
+                if($ask_order_id){
+                    $mode = 55;
+                }
+                GatewayUtils::success($websocket_id, $mode, ['chat_content'=>_mini_emoji($chat_content, true), 'chat_image'=>$chat_image,
                     'from_user'=>UserUtils::get_cached_user($uid) ]);
             }
 

+ 1 - 1
app/Wen/Utils/GatewayUtils.php

@@ -242,7 +242,7 @@ class GatewayUtils{
         if(_empty_($client_id)){
             return false;
         }
-        if(!in_array($mode, [0, 1, 2, 3, 4, 5, 12, 13])){
+        if(!in_array($mode, [0, 1, 2, 3, 4, 5, 12, 13, 55])){
             return false;
         }
         if($mode == 13){