feat: 구매/안전 시스템 전면 개편 — tkpurchase 개편 + tksafety 신규 + 권한 보강
Phase 1: tkuser 협력업체 CRUD 이관 (읽기전용 → 전체 CRUD) Phase 2: tkpurchase 개편 — 일용공 신청/확정, 작업일정, 업무현황, 계정관리, 협력업체 포털 Phase 3: tksafety 신규 시스템 — 방문관리 + 안전교육 신고 Phase 4: SSO 인증 보강 (partner_company_id JWT, 만료일 체크), 권한 테이블 기반 접근 제어 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -92,7 +92,16 @@ async function init() {
|
||||
// 쿠키에서 읽었으면 localStorage에도 백업 (다음 방문 시 쿠키 소실 대비)
|
||||
if (!localStorage.getItem('sso_token')) localStorage.setItem('sso_token', token);
|
||||
|
||||
currentUser = { id: decoded.user_id||decoded.id, username: decoded.username||decoded.sub, name: decoded.name||decoded.full_name, role: (decoded.role||decoded.access_level||'').toLowerCase() };
|
||||
currentUser = { id: decoded.user_id||decoded.id, username: decoded.username||decoded.sub, name: decoded.name||decoded.full_name, role: (decoded.role||decoded.access_level||'').toLowerCase(), partner_company_id: decoded.partner_company_id || null };
|
||||
|
||||
// 협력업체 계정 차단
|
||||
if (currentUser.partner_company_id) {
|
||||
location.href = location.hostname.includes('technicalkorea.net')
|
||||
? 'https://tkpurchase.technicalkorea.net/partner-portal.html'
|
||||
: location.protocol + '//' + location.hostname + ':30480/partner-portal.html';
|
||||
return;
|
||||
}
|
||||
|
||||
const dn = currentUser.name || currentUser.username;
|
||||
document.getElementById('headerUserName').textContent = dn;
|
||||
document.getElementById('headerUserRole').textContent = currentUser.role === 'admin' ? '관리자' : '사용자';
|
||||
|
||||
Reference in New Issue
Block a user