123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\company\controller;
- use app\common\controller\Apic;
- use think\Db;
- use getusersig\getusersig;
- /**
- * 基础配置接口
- */
- class Baseconfig extends Apic
- {
- protected $noNeedLogin = ['*'];
- protected $noNeedRight = ['*'];
-
- public function index(){
- $config = [
- 'nowtime' => date('Y-m-d H:i:s'),
- ];
- $this->success('success',$config);
- }
- //给pc端用的usersig
- //user_用户端小程序,master_师傅,kefu_客服
- public function tenim_usersig(){
- $user_id = "kefu_".$this->auth->company_id;
- // 获取配置信息
- $config = config("tencent_im");
- $usersigObj = new getusersig($config["sdkappid"],$config["key"]);
- $usersig = $usersigObj->genUserSig($user_id);
- $rs = [
- 'usersig' => $usersig,
- 'sdkappid' => $config['sdkappid'],
- ];
- $this->success(1,$rs);
- }
- }
|