This commit is contained in:
liufumingren 2026-08-07 00:29:38 +08:00
parent 94fd06c6ab
commit efb69dc45e

View File

@ -94,12 +94,8 @@ abstract class Base
$url = $this->baseUrl . '/warehouse?' . $queryStr;
$bodyJson = json_encode($body, JSON_UNESCAPED_UNICODE);
\think\Log::info("[WmsFunc] {$method} 请求: " . json_encode([
'url' => $url,
'query' => $queryParams,
'body' => $bodyJson,
'sign' => $sign,
], JSON_UNESCAPED_UNICODE));
// ---- 调试:打印完整请求 ----
\think\Log::error("[WmsFunc] {$method} 请求\nURL: {$url}\nBody: {$bodyJson}");
try {
$response = Http::post($url, $bodyJson, [
@ -113,25 +109,17 @@ abstract class Base
$result = json_decode($response, true);
if ($result === null && json_last_error() !== JSON_ERROR_NONE) {
\think\Log::error("[WmsFunc] {$method} 响应解析失败\nURL: {$url}\nBody: {$bodyJson}\nResponse: {$response}");
return [
'code' => -1,
'msg' => '响应解析失败',
'data' => null,
];
\think\Log::error("[WmsFunc] {$method} 响应解析失败\nResponse: {$response}");
return ['code' => -1, 'msg' => '响应解析失败', 'data' => null];
}
\think\Log::info("[WmsFunc] {$method} 响应: " . json_encode($result, JSON_UNESCAPED_UNICODE));
\think\Log::error("[WmsFunc] {$method} 响应: " . json_encode($result, JSON_UNESCAPED_UNICODE));
return $result;
} catch (\Exception $e) {
\think\Log::error("[WmsFunc] {$method} 请求异常: " . $e->getMessage() . "\nURL: {$url}\nBody: {$bodyJson}");
return [
'code' => -1,
'msg' => '请求异常: ' . $e->getMessage(),
'data' => null,
];
\think\Log::error("[WmsFunc] {$method} 请求异常: " . $e->getMessage());
return ['code' => -1, 'msg' => '请求异常: ' . $e->getMessage(), 'data' => null];
}
}