xiaogang hace 4 años
padre
commit
6621ecd868
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      app/Http/Controllers/Api/ChatController.php

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

xqd
@@ -29,7 +29,10 @@ class ChatController extends Controller
             $tencent_friend =new TencentImFriendService();
 
             //检测是否已经导入IM账号
-            dd( $tencent_account->accountCheck([$request->tencent_im_user_id]));
+            $check_result = $tencent_account->accountCheck([$request->tencent_im_user_id]);
+            if(!isset($check_result) || $check_result['AccountStatus']=="NotImported"){
+                throw new Exception("对方账户错误");
+            }
 
             $res = $tencent_friend->friendAddItem($user->tencent_im_user_id,$request->tencent_im_user_id);
         }catch (\Exception $exception){