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:
mzl
2026-08-26 11:51:40 +08:00
parent 2e2188d6e5
commit 2de6342058
4 changed files with 51 additions and 0 deletions
@@ -136,6 +136,10 @@ class StockOrdersController extends BaseController
];
}
unset($item['options']);
// 附件 url 响应期重签(历史签名URL会过期)
if (!empty($item['attachment']) && is_array($item['attachment'])) {
$item['attachment'] = \app\common\service\OssService::resignAttachmentUrls($item['attachment']);
}
}
unset($item);