UserInfo.php 425 B

12345678910111213141516171819
  1. <?php
  2. namespace app\extra\weMini;
  3. use yzh52521\EasyHttp\Http;
  4. class UserInfo extends BasicWeChat
  5. {
  6. public function getPhoneNumber(string $code = "")
  7. {
  8. $url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=ACCESS_TOKEN";
  9. $this->registerApi($url,"post");
  10. return Http::asJson()->post($url,[
  11. "code" => $code
  12. ])->array();
  13. }
  14. }