diff --git a/system1-factory/web/js/production-dashboard.js b/system1-factory/web/js/production-dashboard.js index c59ad5b..58ae99f 100644 --- a/system1-factory/web/js/production-dashboard.js +++ b/system1-factory/web/js/production-dashboard.js @@ -48,9 +48,10 @@ function escHtml(s) { const d = document.createElement('div'); d.textContent = s async function initDashboard() { showSkeleton(); try { - const token = localStorage.getItem('sso_token') || getCookie('sso_token'); + const token = typeof getToken === 'function' ? getToken() : (localStorage.getItem('sso_token') || getCookie('sso_token')); + if (!token) { showError('로그인이 필요합니다.'); return; } const resp = await fetch('/api/dashboard/my-summary', { - headers: { 'Authorization': 'Bearer ' + token } + headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' } }); if (!resp.ok) throw new Error('API 오류: ' + resp.status); const result = await resp.json();