diff --git a/system1-factory/web/js/production-dashboard.js b/system1-factory/web/js/production-dashboard.js index 58ae99f..a7163b8 100644 --- a/system1-factory/web/js/production-dashboard.js +++ b/system1-factory/web/js/production-dashboard.js @@ -48,13 +48,7 @@ function escHtml(s) { const d = document.createElement('div'); d.textContent = s async function initDashboard() { showSkeleton(); try { - 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, 'Content-Type': 'application/json' } - }); - if (!resp.ok) throw new Error('API 오류: ' + resp.status); - const result = await resp.json(); + const result = await api('/dashboard/my-summary'); if (!result.success) throw new Error(result.message || '데이터 로드 실패'); renderDashboard(result.data); } catch (err) { @@ -62,11 +56,6 @@ async function initDashboard() { } } -function getCookie(name) { - const v = document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)'); - return v ? v.pop() : ''; -} - function renderDashboard(data) { const { user, vacation, overtime, quick_access } = data; diff --git a/system1-factory/web/pages/dashboard-new.html b/system1-factory/web/pages/dashboard-new.html index d8952b9..c85622c 100644 --- a/system1-factory/web/pages/dashboard-new.html +++ b/system1-factory/web/pages/dashboard-new.html @@ -34,6 +34,6 @@ - +