Browse Source

给小程序用的usersig

lizhen_gitee 2 months ago
parent
commit
7f59c0927a

+ 14 - 0
application/api/controller/Baseconfig.php

@@ -97,7 +97,21 @@ class Baseconfig extends Api
         $this->success('success',$config);
     }
 
+    //给小程序端用的usersig
+    public function tenim_usersig(){
 
+        $chat_id = im_prefix($this->auth->id);
+
+        $im = new TencentIm();
+
+        $rs = [
+            'usersig' => $im->get_usersig($chat_id),
+            'sdkappid' => config('tencent_im.sdkappid'),
+        ];
+
+        $this->success(1,$rs);
+
+    }
 
 
 }

+ 4 - 0
application/utils/Service/Tencent/TencentIm.php

@@ -682,6 +682,10 @@ class TencentIm extends Module
         return $newMsgList;
     }
 
+    public function get_usersig($user_id){
+        return $this->usersig($user_id);
+    }
+
     private function postJson(string $uri, array $params = [], array $header = [])
     {
         $random  = rand(10000000, 99999999);