Baseconfig.php 943 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\company\controller;
  3. use app\common\controller\Apic;
  4. use think\Db;
  5. use getusersig\getusersig;
  6. /**
  7. * 基础配置接口
  8. */
  9. class Baseconfig extends Apic
  10. {
  11. protected $noNeedLogin = ['*'];
  12. protected $noNeedRight = ['*'];
  13. public function index(){
  14. $config = [
  15. 'nowtime' => date('Y-m-d H:i:s'),
  16. ];
  17. $this->success('success',$config);
  18. }
  19. //给pc端用的usersig
  20. //user_用户端小程序,master_师傅,kefu_客服
  21. public function tenim_usersig(){
  22. $user_id = "kefu_".$this->auth->company_id;
  23. // 获取配置信息
  24. $config = config("tencent_im");
  25. $usersigObj = new getusersig($config["sdkappid"],$config["key"]);
  26. $usersig = $usersigObj->genUserSig($user_id);
  27. $rs = [
  28. 'usersig' => $usersig,
  29. 'sdkappid' => $config['sdkappid'],
  30. ];
  31. $this->success(1,$rs);
  32. }
  33. }