fix: WhatsApp截图OSS对象键双斜杠(OSS_MAIN_DIR自带尾斜杠)
rtrim 尾斜杠后再拼接,避免 x_server//crm_whatsapp/;已入库记录的键与 OSS对象位置一致不受影响,仅影响后续导入。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -149,7 +149,7 @@ class HesuGoogleWhatsAppImportCommand extends Command
|
|||||||
if (!is_file($path)) {
|
if (!is_file($path)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$mainDir = getenv('OSS_MAIN_DIR') ?: 'x_server';
|
$mainDir = rtrim((string)(getenv('OSS_MAIN_DIR') ?: 'x_server'), '/');
|
||||||
$key = $mainDir . '/crm_whatsapp/' . basename($filename);
|
$key = $mainDir . '/crm_whatsapp/' . basename($filename);
|
||||||
try {
|
try {
|
||||||
(new OssService())->uploadImage($path, $key); // 返回带签名的临时URL,这里只关心落 OSS 的对象键
|
(new OssService())->uploadImage($path, $key); // 返回带签名的临时URL,这里只关心落 OSS 的对象键
|
||||||
|
|||||||
Reference in New Issue
Block a user