BaiduNotifyController.php 673 B

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