Fix: PDF 전용 문서 뷰어 처리 개선

- HTML이 없고 PDF만 있는 문서 클릭 시 PDF 매니저로 자동 리다이렉트
- 뷰어에서 HTML 없는 문서의 경우 PDF 뷰어로 자동 전환
- 문서 관리 페이지에서 PDF 전용 문서 처리 로직 개선
- IndentationError 수정으로 백엔드 안정성 향상
This commit is contained in:
hyungi
2025-09-05 13:00:25 +09:00
parent aebce091a9
commit ed36ced994
4 changed files with 119 additions and 35 deletions

View File

@@ -341,6 +341,16 @@ window.documentApp = () => ({
// 문서 보기
viewDocument(documentId) {
// 문서 정보 찾기
const document = this.documents.find(doc => doc.id === documentId);
// HTML이 없고 PDF만 있는 경우 PDF 매니저로 리다이렉트
if (document && !document.html_path && document.pdf_path) {
console.log('🔄 PDF 전용 문서 - PDF 매니저로 리다이렉트');
window.location.href = `/pdf-manager.html`;
return;
}
// 현재 페이지 정보를 세션 스토리지에 저장
const currentPage = window.location.pathname.split('/').pop() || 'index.html';
sessionStorage.setItem('previousPage', currentPage);