Browse Source

注册用户到腾讯im

lizhen_gitee 10 months ago
parent
commit
ac569a6d15
1 changed files with 10 additions and 1 deletions
  1. 10 1
      application/common/library/Authdoctor.php

+ 10 - 1
application/common/library/Authdoctor.php

@@ -244,12 +244,21 @@ class Authdoctor
             }
 
             //[环信]注册用户。忽略失败
-            $easemob = new Easemob();
+            /*$easemob = new Easemob();
             $rs = $easemob->user_create('doctor'.$user->id);
             if($rs === false){
                 $this->setError('注册用户失败');
                 Db::rollback();
                 return false;
+            }*/
+
+            //腾讯im注册用户
+            $tenim = new Tenim();
+            $rs = $tenim->register('doctor'.$user->id,$params['nickname'],'');
+            if($rs !== true){
+                $this->setError($rs);
+                Db::rollback();
+                return false;
             }
 
             //注册成功的事件