fix: 备货单车辆附件图片过期打不开——url 改为响应期重签
原因:attachment[].url 存的是上传时生成的带签名OSS地址(默认1小时 有效),过期后 AccessDenied/Request has expired。 修复:OssService 新增 resignAttachmentUrls(),从存量 url(完整签名URL/ 未签名URL/纯对象键三种格式)提取对象键重新签名(7天); detail(prepareVehicleListData)与 show(crm/admin 两控制器 showFormat 的 items)三处响应时统一重签。存储不动,前端无需改。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -914,6 +914,13 @@ class StockOrdersService
|
||||
'attachment' => is_array($v->attachment) ? $v->attachment : [],
|
||||
] + $moneyValues;
|
||||
}
|
||||
// 附件 url 响应期重签(历史存的是上传时的签名URL,会过期)
|
||||
foreach ($vehList as &$row) {
|
||||
if (!empty($row['attachment'])) {
|
||||
$row['attachment'] = \app\common\service\OssService::resignAttachmentUrls($row['attachment']);
|
||||
}
|
||||
}
|
||||
unset($row);
|
||||
return ['list' => $vehList];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user