瀏覽代碼

给小程序用的usersig

lizhen_gitee 2 月之前
父節點
當前提交
7f59c0927a
共有 2 個文件被更改,包括 18 次插入0 次删除
  1. 14 0
      application/api/controller/Baseconfig.php
  2. 4 0
      application/utils/Service/Tencent/TencentIm.php

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