diff --git a/application/extra/wms.php b/application/extra/wms.php index 2fa22f1..722c584 100644 --- a/application/extra/wms.php +++ b/application/extra/wms.php @@ -7,7 +7,7 @@ */ return [ // WMS 仓库接口基础地址(不含 /warehouse) - 'base_url' => 'https://wms.wms.gztbyc.com', + 'base_url' => 'https://qimen.wms.gztbyc.com', // 应用 Key(由 WMS 平台分配,联系仓库管理员获取) 'app_key' => 'AK2026080314055697eb6c36', diff --git a/application/index/library/new_wms/func/Base.php b/application/index/library/new_wms/func/Base.php index 0154dad..208d4fd 100644 --- a/application/index/library/new_wms/func/Base.php +++ b/application/index/library/new_wms/func/Base.php @@ -76,7 +76,7 @@ abstract class Base $body = !empty($body) ? $body : new \stdClass(); // 空 body → {} // ---- 构建 query 参数 ---- - $timestamp = (string) time(); + $timestamp = time(); $nonce = $this->generateNonce(16); $queryParams = array_merge([ 'app_key' => $this->appKey, @@ -90,7 +90,8 @@ abstract class Base $sign = $this->signer->make($queryParams, $body); // ---- 发起请求 ---- - $url = $this->baseUrl . '/warehouse'; + $queryStr = http_build_query(array_merge($queryParams, ['sign' => $sign])); + $url = $this->baseUrl . '/warehouse?' . $queryStr; $bodyJson = json_encode($body, JSON_UNESCAPED_UNICODE); \think\Log::info("[WmsFunc] {$method} 请求: " . json_encode([ @@ -104,10 +105,6 @@ abstract class Base $response = Http::post($url, $bodyJson, [ CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', - 'X-App-Key: ' . $this->appKey, - 'X-Timestamp: ' . $timestamp, - 'X-Nonce: ' . $nonce, - 'X-Sign: ' . $sign, ], CURLOPT_TIMEOUT => $this->timeout, CURLOPT_CONNECTTIMEOUT => $this->connectTimeout,