fix(tkpurchase): API 요청에 _t= 타임스탬프 캐시버스터 추가

디버깅 결과 서버(DB→Model→API) 모두 정상 3건 반환 확인.
브라우저/프록시 레벨 캐싱이 원인으로 추정되어
api() 함수에 Date.now() 기반 캐시버스터 파라미터 추가.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-16 08:27:06 +09:00
parent 8ed0b832ab
commit 5d24584553
10 changed files with 14 additions and 13 deletions

View File

@@ -133,7 +133,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031603"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031604"></script>
<script src="/static/js/tkpurchase-accounts.js?v=2026031601"></script>
<script>initAccountsPage();</script>
</body>

View File

@@ -148,7 +148,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031603"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031604"></script>
<script src="/static/js/tkpurchase-daylabor.js?v=2026031601"></script>
<script>initDayLaborPage();</script>
</body>

View File

@@ -88,7 +88,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031603"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031604"></script>
<script src="/static/js/tkpurchase-dashboard.js?v=2026031601"></script>
<script>initDashboard();</script>
</body>

View File

@@ -61,8 +61,8 @@
<div id="historyPagination" class="mt-4 flex justify-center gap-2"></div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031603"></script>
<script src="/static/js/tkpurchase-partner-history.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031604"></script>
<script src="/static/js/tkpurchase-partner-history.js?v=2026031602"></script>
<script>initPartnerHistory();</script>
</body>
</html>

View File

@@ -81,8 +81,8 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031603"></script>
<script src="/static/js/tkpurchase-partner-portal.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031604"></script>
<script src="/static/js/tkpurchase-partner-portal.js?v=2026031602"></script>
<script>initPartnerPortal();</script>
</body>
</html>

View File

@@ -294,7 +294,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031603"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031604"></script>
<script src="/static/js/tkpurchase-partner.js?v=2026031601"></script>
<script>initPartnerPage();</script>
</body>

View File

@@ -275,8 +275,8 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031603"></script>
<script src="/static/js/tkpurchase-schedule.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031604"></script>
<script src="/static/js/tkpurchase-schedule.js?v=2026031602"></script>
<script>initSchedulePage();</script>
</body>
</html>

View File

@@ -40,7 +40,8 @@ async function api(path, opts = {}) {
const token = getToken();
const headers = { 'Authorization': token ? `Bearer ${token}` : '', ...(opts.headers||{}) };
if (!(opts.body instanceof FormData)) headers['Content-Type'] = 'application/json';
const res = await fetch(API_BASE + path, { ...opts, headers, cache: 'no-store' });
const cacheBust = path.includes('?') ? '&_t=' + Date.now() : '?_t=' + Date.now();
const res = await fetch(API_BASE + path + cacheBust, { ...opts, headers, cache: 'no-store' });
if (res.status === 401) { _safeRedirect(); throw new Error('인증 만료'); }
if (res.headers.get('content-type')?.includes('text/csv')) return res;
const data = await res.json();

View File

@@ -100,7 +100,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031603"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031604"></script>
<script src="/static/js/tkpurchase-workreport-summary.js?v=2026031601"></script>
<script>initSummaryPage();</script>
</body>

View File

@@ -114,7 +114,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031603"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031604"></script>
<script src="/static/js/tkpurchase-workreport.js?v=2026031601"></script>
<script>initWorkReportPage();</script>
</body>