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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user