xiaogang 4 rokov pred
rodič
commit
6621ecd868

+ 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){