Browse Source

给前端提供腾讯IM,usersig

lizhen_gitee 6 months ago
parent
commit
b635d8003a
2 changed files with 18 additions and 5 deletions
  1. 13 0
      application/api/controller/Baseconfig.php
  2. 5 5
      application/config.php

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

@@ -4,6 +4,7 @@ namespace app\api\controller;
 
 use app\common\controller\Api;
 use think\Db;
+use getusersig\getusersig;
 /**
  * 基础配置接口
  */
@@ -27,6 +28,18 @@ class Baseconfig extends Api
         $this->success('success',$config);
     }
 
+    //给小程序和pc端用的usersig
+    public function tenim_usersig(){
+        $user_id = "administrator";
+
+        // 获取配置信息
+        $config = config("tencent_im");
+        $usersigObj = new getusersig($config["sdkappid"],$config["key"]);
+        $usersig = $usersigObj->genUserSig($user_id);
+
+        $this->success(1,$usersig);
+    }
+
 
     /**
      * 获取安卓版本更新信息

+ 5 - 5
application/config.php

@@ -332,16 +332,16 @@ return [
         'secret' => '8a743955faa5873af394f31d4a58c086',
     ],
 
-    //腾讯云 IM
+    //腾讯云 IM  ,健康E家中间废弃的一个账号
     'tencent_im' => [
-        'sdkappid' => '',
+        'sdkappid' => '1600043158',
         'identifier' => '',
 
         //trtc回调秘钥
         'callback_secret' => '',
-        'key' => '',
-        'SecretId' => '',
-        'SecretKey' => '',
+        'key' => '7b71ce42785aa7204b17bac79471891128d9bc93aa6fad8ac752fe9e11acc88b',
+        'SecretId' => 'AKIDkzFPUew88ua5TlCbvKkz1xqswra7Ynoc',
+        'SecretKey' => 'gEUXTEm6D6mKm5FF6qQnwsbAWgdMzOao',
     ],
 
     //阿里云短信配置