Browse Source

wd更换网关 请求头添加ua

Tree 1 ngày trước cách đây
mục cha
commit
3373581d09
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      app/Services/WDPay.php

+ 2 - 0
app/Services/WDPay.php

@@ -155,8 +155,10 @@ class WDPay
         // WDPay使用 application/x-www-form-urlencoded 格式
         $data = http_build_query($payload);
         
+        $requestUa = request()->userAgent() ?: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
         $headers = [
             'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
+            'User-Agent: ' . $requestUa,
         ];
 
         $ch = curl_init();