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 的对象键