refactor: 프론트엔드 SSO 인증 통합 및 API 경로 정리

- Gateway 로그인/포탈 페이지 SSO 연동
- System1 web/fastapi-bridge API base URL 동적 설정
- SSO 토큰 기반 인증 흐름 통일
- deprecated JS 파일 삭제

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-06 23:18:09 +09:00
parent ec755ed52f
commit 61c810bd47
63 changed files with 255 additions and 1357 deletions

View File

@@ -50,13 +50,11 @@ const elements = {
// ========== 초기화 ========== //
document.addEventListener('DOMContentLoaded', async () => {
console.log('🔧 관리자 설정 페이지 초기화 시작');
try {
await initializePage();
console.log('✅ 관리자 설정 페이지 초기화 완료');
} catch (error) {
console.error(' 페이지 초기화 오류:', error);
console.error(' 페이지 초기화 오류:', error);
showToast('페이지를 불러오는 중 오류가 발생했습니다.', 'error');
}
});
@@ -75,7 +73,6 @@ function setupUserInfo() {
const authData = getAuthData();
if (authData && authData.user) {
currentUser = authData.user;
console.log('👤 사용자 정보 로드 완료:', currentUser.name, currentUser.role);
}
}
@@ -150,13 +147,11 @@ function setupEventListeners() {
// ========== 사용자 관리 ========== //
async function loadUsers() {
try {
console.log('👥 사용자 목록 로딩...');
// 실제 API에서 사용자 데이터 가져오기
const response = await window.apiCall('/users');
users = Array.isArray(response) ? response : (response.data || []);
console.log(`✅ 사용자 ${users.length}명 로드 완료`);
// 필터링된 사용자 목록 초기화
filteredUsers = [...users];
@@ -165,7 +160,7 @@ async function loadUsers() {
renderUsersTable();
} catch (error) {
console.error(' 사용자 목록 로딩 오류:', error);
console.error(' 사용자 목록 로딩 오류:', error);
showToast('사용자 목록을 불러오는 중 오류가 발생했습니다.', 'error');
users = [];
filteredUsers = [];
@@ -556,9 +551,8 @@ async function loadAllPages() {
try {
const response = await apiCall('/pages');
allPages = response.data || response || [];
console.log('📄 페이지 목록 로드:', allPages.length, '개');
} catch (error) {
console.error(' 페이지 목록 로드 오류:', error);
console.error(' 페이지 목록 로드 오류:', error);
allPages = [];
}
}
@@ -568,9 +562,8 @@ async function loadUserPageAccess(userId) {
try {
const response = await apiCall(`/users/${userId}/page-access`);
userPageAccess = response.data?.pageAccess || [];
console.log(`👤 사용자 ${userId} 페이지 권한 로드:`, userPageAccess.length, '개');
} catch (error) {
console.error(' 사용자 페이지 권한 로드 오류:', error);
console.error(' 사용자 페이지 권한 로드 오류:', error);
userPageAccess = [];
}
}
@@ -595,15 +588,13 @@ async function savePageAccess(userId, containerId = null) {
const pageAccessData = Array.from(pageAccessMap.values());
console.log('📤 페이지 권한 저장:', userId, pageAccessData);
await apiCall(`/users/${userId}/page-access`, 'PUT', {
pageAccess: pageAccessData
});
console.log('✅ 페이지 권한 저장 완료');
} catch (error) {
console.error(' 페이지 권한 저장 오류:', error);
console.error(' 페이지 권한 저장 오류:', error);
throw error;
}
}
@@ -647,7 +638,7 @@ async function managePageAccess(userId) {
// 모달 표시
document.getElementById('pageAccessModal').style.display = 'flex';
} catch (error) {
console.error(' 페이지 권한 관리 모달 오류:', error);
console.error(' 페이지 권한 관리 모달 오류:', error);
showToast('페이지 권한 관리를 열 수 없습니다.', 'error');
}
}
@@ -775,7 +766,7 @@ async function savePageAccessFromModal() {
closePageAccessModal();
} catch (error) {
console.error(' 페이지 권한 저장 오류:', error);
console.error(' 페이지 권한 저장 오류:', error);
showToast('페이지 권한 저장에 실패했습니다.', 'error');
}
}