Lỗi có thể di chuyển tù sharedlink sang public nhưng không có hotspot quay lại

This commit is contained in:
2026-06-11 16:27:37 +07:00
parent be149f26ca
commit 0434837026
7 changed files with 1055 additions and 47 deletions
+6 -1
View File
@@ -24,6 +24,8 @@ const uploadDir = process.env.UPLOAD_DIR
*/
router.get('/assets/view/:assetId', verifyReferer, optionalAuth, async (req, res) => {
try {
console.log(`[AssetView] Đang yêu cầu hiển thị Asset: ${req.params.assetId}. Token: ${req.query.token ? 'Có' : 'Không'}`);
const asset = await Asset.findById(req.params.assetId);
if (!asset) return res.status(404).json({ message: 'Asset not found' });
@@ -88,7 +90,10 @@ router.get('/assets/view/:assetId', verifyReferer, optionalAuth, async (req, res
}
}
if (!hasAccess) return res.status(403).json({ message: 'Bạn không được phép di chuyển đến cảnh này' });
if (!hasAccess) {
console.warn(`[AssetView Denied] Không có quyền xem ảnh cho Asset ${asset._id}`);
return res.status(403).json({ message: 'Bạn không được phép di chuyển đến cảnh này' });
}
}
// Kiểm tra file vật lý (Giai đoạn 2 - Async)