修复:回退proxyScreenshotImage中同步触发截图逻辑,解决状态栏全红和图片损坏
proxyScreenshotImage是HEAD/GET快速响应接口,不应同步阻塞15秒等待边缘端截图。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -320,17 +320,8 @@ public class AiScreenshotServiceImpl implements IAiScreenshotService {
|
||||
// 1. 查 DB 持久化的 cos_key(永不过期)- 优先直接操作 COS
|
||||
String cosKey = snapshotMapper.getCosKey(cameraCode);
|
||||
if (cosKey == null) {
|
||||
// DB 无记录,自动触发一次截图并等待持久化
|
||||
log.info("[AI截图] 代理图片: 无持久化记录,自动触发截图 cameraCode={}", cameraCode);
|
||||
Map<String, Object> snapResult = requestScreenshot(cameraCode, true);
|
||||
if ("ok".equals(snapResult.get("status"))) {
|
||||
// 截图成功,重新查 DB
|
||||
cosKey = snapshotMapper.getCosKey(cameraCode);
|
||||
}
|
||||
if (cosKey == null) {
|
||||
log.warn("[AI截图] 代理图片: 自动截图后仍无持久化记录 cameraCode={}", cameraCode);
|
||||
return null;
|
||||
}
|
||||
log.warn("[AI截图] 代理图片: 无持久化记录 cameraCode={}", cameraCode);
|
||||
return null;
|
||||
}
|
||||
|
||||
// 2. 通过 CosUtil 直接生成 presigned URL
|
||||
|
||||
Reference in New Issue
Block a user