ddclient.php 554 B

123456789101112131415161718192021
  1. <?php
  2. namespace app\components\OpenAuth\core;
  3. use app\common\helpers\Session;
  4. use \Exception;
  5. use Yii;
  6. class DDclient {
  7. function __construct($access_token, $refresh_token = NULL) {
  8. $this->oauth = new DD($access_token, $refresh_token);
  9. }
  10. //获取用户信息
  11. public function get_user_info()
  12. {
  13. $url = "https://api.dingtalk.com/v1.0/contact/users/me/";
  14. $header['x-acs-dingtalk-access-token'] = $this->oauth->access_token;
  15. $result = https_request($url,null,null,$header);
  16. return $result;
  17. }
  18. }