From 21c1d6afd9442f9da74b51d94f16db3938da69be Mon Sep 17 00:00:00 2001 From: mzl Date: Wed, 19 Aug 2026 10:45:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20WhatsApp=E6=88=AA=E5=9B=BEOSS=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E9=94=AE=E5=8F=8C=E6=96=9C=E6=9D=A0=EF=BC=88OSS=5FMAI?= =?UTF-8?q?N=5FDIR=E8=87=AA=E5=B8=A6=E5=B0=BE=E6=96=9C=E6=9D=A0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rtrim 尾斜杠后再拼接,避免 x_server//crm_whatsapp/;已入库记录的键与 OSS对象位置一致不受影响,仅影响后续导入。 Co-Authored-By: Claude --- app/command/HesuGoogleWhatsAppImportCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/command/HesuGoogleWhatsAppImportCommand.php b/app/command/HesuGoogleWhatsAppImportCommand.php index ed818e9..0e2e22f 100644 --- a/app/command/HesuGoogleWhatsAppImportCommand.php +++ b/app/command/HesuGoogleWhatsAppImportCommand.php @@ -149,7 +149,7 @@ class HesuGoogleWhatsAppImportCommand extends Command if (!is_file($path)) { return null; } - $mainDir = getenv('OSS_MAIN_DIR') ?: 'x_server'; + $mainDir = rtrim((string)(getenv('OSS_MAIN_DIR') ?: 'x_server'), '/'); $key = $mainDir . '/crm_whatsapp/' . basename($filename); try { (new OssService())->uploadImage($path, $key); // 返回带签名的临时URL,这里只关心落 OSS 的对象键