WeCallNotifyController.php 741 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\api\controller\notify;
  3. use app\api\controller\BaseApiController;
  4. use think\facade\Log;
  5. /**
  6. * 网易云商外呼任务回调接口
  7. * Class WeCallNotifyController
  8. * @package app\api\controller\notify
  9. */
  10. class WeCallNotifyController extends BaseApiController
  11. {
  12. public array $notNeedLogin = ['notify'];
  13. public function notify(): void
  14. {
  15. $params = $this->request->param();
  16. Log::write(json_encode($this->request->param()));
  17. if($this->request->param()){
  18. $url = 'https://u.baidu.com/oauth/accessToken';
  19. $result = http_request($url,$this->request->param(),['Content-Type'=>'application/json;charset:utf-8;']);
  20. Log::write($result);
  21. }
  22. }
  23. }