diff --git a/system1-factory/web/js/my-monthly-confirm.js b/system1-factory/web/js/my-monthly-confirm.js index a71e15a..b1d683b 100644 --- a/system1-factory/web/js/my-monthly-confirm.js +++ b/system1-factory/web/js/my-monthly-confirm.js @@ -24,7 +24,9 @@ document.addEventListener('DOMContentLoaded', function() { if (params.get('month')) currentMonth = parseInt(params.get('month')); setTimeout(function() { - if (!window.currentUser) return; + var user = typeof getCurrentUser === 'function' ? getCurrentUser() : window.currentUser; + if (!user) return; + window._mmcUser = user; updateMonthLabel(); loadData(); }, 500); @@ -49,7 +51,8 @@ async function loadData() { tableWrap.innerHTML = '
'; try { - var userId = window.currentUser.user_id || window.currentUser.id; + var user = window._mmcUser || (typeof getCurrentUser === 'function' ? getCurrentUser() : null) || {}; + var userId = user.user_id || user.id; var [recordsRes, balanceRes] = await Promise.all([ window.apiCall('/monthly-comparison/my-records?year=' + currentYear + '&month=' + currentMonth), window.apiCall('/attendance/vacation-balance/' + userId).catch(function() { return { success: true, data: [] }; }) diff --git a/system1-factory/web/pages/attendance/my-monthly-confirm.html b/system1-factory/web/pages/attendance/my-monthly-confirm.html index a2914f9..7b2914a 100644 --- a/system1-factory/web/pages/attendance/my-monthly-confirm.html +++ b/system1-factory/web/pages/attendance/my-monthly-confirm.html @@ -103,7 +103,7 @@ - +