console.log 삭제
This commit is contained in:
parent
7acea0b272
commit
f715b5fa8c
|
|
@ -15,7 +15,6 @@ const prisma = new PrismaClient({
|
|||
async function testConnection() {
|
||||
try {
|
||||
await prisma.$connect();
|
||||
console.log("✅ 데이터베이스 연결 성공");
|
||||
} catch (error) {
|
||||
console.error("❌ 데이터베이스 연결 실패:", error);
|
||||
process.exit(1);
|
||||
|
|
|
|||
|
|
@ -181,14 +181,6 @@ export class AuthController {
|
|||
return;
|
||||
}
|
||||
|
||||
// DB에서 조회한 원본 사용자 정보 로그
|
||||
console.log("🔍 DB에서 조회한 사용자 정보:", {
|
||||
userId: dbUserInfo.userId,
|
||||
companyCode: dbUserInfo.companyCode,
|
||||
deptCode: dbUserInfo.deptCode,
|
||||
dbUserInfoKeys: Object.keys(dbUserInfo),
|
||||
});
|
||||
|
||||
// 프론트엔드 호환성을 위해 더 많은 사용자 정보 반환
|
||||
const userInfoResponse: any = {
|
||||
userId: dbUserInfo.userId,
|
||||
|
|
@ -206,13 +198,6 @@ export class AuthController {
|
|||
dbUserInfo.userType === "ADMIN" || dbUserInfo.userId === "plm_admin",
|
||||
};
|
||||
|
||||
console.log("📤 프론트엔드로 전송할 사용자 정보:", {
|
||||
companyCode: userInfoResponse.companyCode,
|
||||
company_code: userInfoResponse.company_code,
|
||||
deptCode: userInfoResponse.deptCode,
|
||||
responseKeys: Object.keys(userInfoResponse),
|
||||
});
|
||||
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
message: "사용자 정보 조회 성공",
|
||||
|
|
|
|||
|
|
@ -414,10 +414,6 @@ class ComponentStandardController {
|
|||
req.user?.companyCode
|
||||
);
|
||||
|
||||
console.log(
|
||||
`🔍 중복 체크 결과: component_code=${component_code}, company_code=${req.user?.companyCode}, isDuplicate=${isDuplicate}`
|
||||
);
|
||||
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
data: { isDuplicate, component_code },
|
||||
|
|
|
|||
|
|
@ -125,20 +125,6 @@ export const createDataflowDiagram = async (req: Request, res: Response) => {
|
|||
});
|
||||
}
|
||||
|
||||
// 🔍 백엔드에서 받은 실제 데이터 로깅
|
||||
console.log(
|
||||
"🔍 백엔드에서 받은 control 데이터:",
|
||||
JSON.stringify(control, null, 2)
|
||||
);
|
||||
console.log(
|
||||
"🔍 백엔드에서 받은 plan 데이터:",
|
||||
JSON.stringify(plan, null, 2)
|
||||
);
|
||||
console.log(
|
||||
"🔍 백엔드에서 받은 category 데이터:",
|
||||
JSON.stringify(category, null, 2)
|
||||
);
|
||||
|
||||
const newDiagram = await createDataflowDiagramService({
|
||||
diagram_name,
|
||||
relationships,
|
||||
|
|
|
|||
|
|
@ -11,14 +11,6 @@ export const saveFormData = async (
|
|||
const { companyCode, userId } = req.user as any;
|
||||
const { screenId, tableName, data } = req.body;
|
||||
|
||||
console.log("💾 폼 데이터 저장 요청:", {
|
||||
userId,
|
||||
companyCode,
|
||||
screenId,
|
||||
tableName,
|
||||
data,
|
||||
});
|
||||
|
||||
// 필수 필드 검증
|
||||
if (!screenId || !tableName || !data) {
|
||||
return res.status(400).json({
|
||||
|
|
@ -49,8 +41,6 @@ export const saveFormData = async (
|
|||
formDataWithMeta
|
||||
);
|
||||
|
||||
console.log("✅ 폼 데이터 저장 성공:", result);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: result,
|
||||
|
|
@ -75,14 +65,6 @@ export const updateFormData = async (
|
|||
const { companyCode, userId } = req.user as any;
|
||||
const { tableName, data } = req.body;
|
||||
|
||||
console.log("🔄 폼 데이터 업데이트 요청:", {
|
||||
id,
|
||||
userId,
|
||||
companyCode,
|
||||
tableName,
|
||||
data,
|
||||
});
|
||||
|
||||
if (!tableName || !data) {
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
|
|
@ -103,8 +85,6 @@ export const updateFormData = async (
|
|||
formDataWithMeta
|
||||
);
|
||||
|
||||
console.log("✅ 폼 데이터 업데이트 성공:", result);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: result,
|
||||
|
|
@ -129,8 +109,6 @@ export const deleteFormData = async (
|
|||
const { companyCode } = req.user as any;
|
||||
const { tableName } = req.body;
|
||||
|
||||
console.log("🗑️ 폼 데이터 삭제 요청:", { id, companyCode, tableName });
|
||||
|
||||
if (!tableName) {
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
|
|
@ -140,8 +118,6 @@ export const deleteFormData = async (
|
|||
|
||||
await dynamicFormService.deleteFormData(parseInt(id), tableName);
|
||||
|
||||
console.log("✅ 폼 데이터 삭제 성공");
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
message: "데이터가 성공적으로 삭제되었습니다.",
|
||||
|
|
@ -164,8 +140,6 @@ export const getFormData = async (
|
|||
const { id } = req.params;
|
||||
const { companyCode } = req.user as any;
|
||||
|
||||
console.log("📄 폼 데이터 단건 조회 요청:", { id, companyCode });
|
||||
|
||||
const data = await dynamicFormService.getFormData(parseInt(id));
|
||||
|
||||
if (!data) {
|
||||
|
|
@ -175,8 +149,6 @@ export const getFormData = async (
|
|||
});
|
||||
}
|
||||
|
||||
console.log("✅ 폼 데이터 단건 조회 성공");
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: data,
|
||||
|
|
@ -206,16 +178,6 @@ export const getFormDataList = async (
|
|||
sortOrder = "desc",
|
||||
} = req.query;
|
||||
|
||||
console.log("📋 폼 데이터 목록 조회 요청:", {
|
||||
screenId,
|
||||
companyCode,
|
||||
page,
|
||||
size,
|
||||
search,
|
||||
sortBy,
|
||||
sortOrder,
|
||||
});
|
||||
|
||||
const result = await dynamicFormService.getFormDataList(
|
||||
parseInt(screenId as string),
|
||||
{
|
||||
|
|
@ -227,8 +189,6 @@ export const getFormDataList = async (
|
|||
}
|
||||
);
|
||||
|
||||
console.log("✅ 폼 데이터 목록 조회 성공");
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: result,
|
||||
|
|
@ -250,8 +210,6 @@ export const validateFormData = async (
|
|||
try {
|
||||
const { tableName, data } = req.body;
|
||||
|
||||
console.log("✅ 폼 데이터 검증 요청:", { tableName, data });
|
||||
|
||||
if (!tableName || !data) {
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
|
|
@ -264,8 +222,6 @@ export const validateFormData = async (
|
|||
data
|
||||
);
|
||||
|
||||
console.log("✅ 폼 데이터 검증 성공:", validationResult);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: validationResult,
|
||||
|
|
@ -287,12 +243,8 @@ export const getTableColumns = async (
|
|||
try {
|
||||
const { tableName } = req.params;
|
||||
|
||||
console.log("📊 테이블 컬럼 정보 조회 요청:", { tableName });
|
||||
|
||||
const columns = await dynamicFormService.getTableColumns(tableName);
|
||||
|
||||
console.log("✅ 테이블 컬럼 정보 조회 성공");
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ const storage = multer.diskStorage({
|
|||
if (!fs.existsSync(tempDir)) {
|
||||
fs.mkdirSync(tempDir, { recursive: true });
|
||||
}
|
||||
console.log(`📁 임시 업로드 디렉토리: ${tempDir}`);
|
||||
cb(null, tempDir);
|
||||
},
|
||||
filename: (req, file, cb) => {
|
||||
|
|
@ -51,7 +50,6 @@ const storage = multer.diskStorage({
|
|||
const timestamp = Date.now();
|
||||
const sanitizedName = file.originalname.replace(/[^a-zA-Z0-9.-]/g, "_");
|
||||
const savedFileName = `${timestamp}_${sanitizedName}`;
|
||||
console.log(`📄 저장 파일명: ${savedFileName}`);
|
||||
cb(null, savedFileName);
|
||||
},
|
||||
});
|
||||
|
|
@ -64,18 +62,12 @@ const upload = multer({
|
|||
fileFilter: (req, file, cb) => {
|
||||
// 프론트엔드에서 전송된 accept 정보 확인
|
||||
const acceptHeader = req.body?.accept;
|
||||
console.log("🔍 파일 타입 검증:", {
|
||||
fileName: file.originalname,
|
||||
mimeType: file.mimetype,
|
||||
acceptFromFrontend: acceptHeader,
|
||||
});
|
||||
|
||||
// 프론트엔드에서 */* 또는 * 허용한 경우 모든 파일 허용
|
||||
if (
|
||||
acceptHeader &&
|
||||
(acceptHeader.includes("*/*") || acceptHeader.includes("*"))
|
||||
) {
|
||||
console.log("✅ 와일드카드 허용: 모든 파일 타입 허용");
|
||||
cb(null, true);
|
||||
return;
|
||||
}
|
||||
|
|
@ -97,10 +89,8 @@ const upload = multer({
|
|||
];
|
||||
|
||||
if (defaultAllowedTypes.includes(file.mimetype)) {
|
||||
console.log("✅ 기본 허용 파일 타입:", file.mimetype);
|
||||
cb(null, true);
|
||||
} else {
|
||||
console.log("❌ 허용되지 않는 파일 타입:", file.mimetype);
|
||||
cb(new Error("허용되지 않는 파일 타입입니다."));
|
||||
}
|
||||
},
|
||||
|
|
@ -114,23 +104,6 @@ export const uploadFiles = async (
|
|||
res: Response
|
||||
): Promise<void> => {
|
||||
try {
|
||||
console.log("📤 파일 업로드 요청 수신:", {
|
||||
body: req.body,
|
||||
companyCode: req.body.companyCode,
|
||||
writer: req.body.writer,
|
||||
docType: req.body.docType,
|
||||
user: req.user
|
||||
? {
|
||||
userId: req.user.userId,
|
||||
companyCode: req.user.companyCode,
|
||||
deptCode: req.user.deptCode,
|
||||
}
|
||||
: "no user",
|
||||
files: req.files
|
||||
? (req.files as Express.Multer.File[]).map((f) => f.originalname)
|
||||
: "none",
|
||||
});
|
||||
|
||||
if (!req.files || (req.files as Express.Multer.File[]).length === 0) {
|
||||
res.status(400).json({
|
||||
success: false,
|
||||
|
|
@ -141,13 +114,6 @@ export const uploadFiles = async (
|
|||
|
||||
const files = req.files as Express.Multer.File[];
|
||||
|
||||
// 파라미터 확인 및 로깅
|
||||
console.log("📤 파일 업로드 요청 수신:", {
|
||||
filesCount: files?.length || 0,
|
||||
bodyKeys: Object.keys(req.body),
|
||||
fullBody: req.body, // 전체 body 내용 확인
|
||||
});
|
||||
|
||||
const {
|
||||
docType = "DOCUMENT",
|
||||
docTypeName = "일반 문서",
|
||||
|
|
@ -177,26 +143,8 @@ export const uploadFiles = async (
|
|||
} else {
|
||||
finalTargetObjid = `${linkedTable}:${recordId}`;
|
||||
}
|
||||
|
||||
console.log("🔗 자동 연결 활성화:", {
|
||||
linkedTable,
|
||||
linkedField,
|
||||
recordId,
|
||||
columnName,
|
||||
isVirtualFileColumn,
|
||||
generatedTargetObjid: finalTargetObjid,
|
||||
});
|
||||
}
|
||||
|
||||
console.log("🔍 사용자 정보 결정:", {
|
||||
bodyCompanyCode: req.body.companyCode,
|
||||
userCompanyCode: (req.user as any)?.companyCode,
|
||||
finalCompanyCode: companyCode,
|
||||
bodyWriter: req.body.writer,
|
||||
userWriter: (req.user as any)?.userId,
|
||||
finalWriter: writer,
|
||||
});
|
||||
|
||||
const savedFiles = [];
|
||||
|
||||
for (const file of files) {
|
||||
|
|
@ -218,23 +166,11 @@ export const uploadFiles = async (
|
|||
const relativePath = `/${actualCompanyCode}/${dateFolder}/${file.filename}`;
|
||||
const fullFilePath = `/uploads${relativePath}`;
|
||||
|
||||
console.log("📂 파일 경로 설정:", {
|
||||
companyCode,
|
||||
filename: file.filename,
|
||||
relativePath,
|
||||
fullFilePath,
|
||||
});
|
||||
|
||||
// 임시 파일을 최종 위치로 이동
|
||||
const tempFilePath = file.path; // Multer가 저장한 임시 파일 경로
|
||||
const finalUploadDir = getCompanyUploadDir(companyCode, dateFolder);
|
||||
const finalFilePath = path.join(finalUploadDir, file.filename);
|
||||
|
||||
console.log("📦 파일 이동:", {
|
||||
from: tempFilePath,
|
||||
to: finalFilePath,
|
||||
});
|
||||
|
||||
// 파일 이동
|
||||
fs.renameSync(tempFilePath, finalFilePath);
|
||||
|
||||
|
|
@ -261,13 +197,6 @@ export const uploadFiles = async (
|
|||
},
|
||||
});
|
||||
|
||||
console.log("💾 파일 정보 DB 저장 완료:", {
|
||||
objid: fileRecord.objid.toString(),
|
||||
saved_file_name: fileRecord.saved_file_name,
|
||||
real_file_name: fileRecord.real_file_name,
|
||||
file_size: fileRecord.file_size?.toString(),
|
||||
});
|
||||
|
||||
savedFiles.push({
|
||||
objid: fileRecord.objid.toString(),
|
||||
savedFileName: fileRecord.saved_file_name,
|
||||
|
|
@ -284,13 +213,6 @@ export const uploadFiles = async (
|
|||
regdate: fileRecord.regdate?.toISOString(),
|
||||
status: fileRecord.status,
|
||||
});
|
||||
|
||||
console.log("✅ 파일 저장 결과:", {
|
||||
objid: fileRecord.objid.toString(),
|
||||
company_code: companyCode,
|
||||
file_path: fileRecord.file_path,
|
||||
writer: fileRecord.writer,
|
||||
});
|
||||
}
|
||||
|
||||
res.json({
|
||||
|
|
@ -319,8 +241,6 @@ export const deleteFile = async (
|
|||
const { objid } = req.params;
|
||||
const { writer = "system" } = req.body;
|
||||
|
||||
console.log("🗑️ 파일 삭제 요청:", { objid, writer });
|
||||
|
||||
// 파일 상태를 DELETED로 변경 (논리적 삭제)
|
||||
const deletedFile = await prisma.attach_file_info.update({
|
||||
where: {
|
||||
|
|
@ -331,11 +251,6 @@ export const deleteFile = async (
|
|||
},
|
||||
});
|
||||
|
||||
console.log("✅ 파일 삭제 완료 (논리적):", {
|
||||
objid: deletedFile.objid.toString(),
|
||||
status: deletedFile.status,
|
||||
});
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
message: "파일이 삭제되었습니다.",
|
||||
|
|
@ -360,21 +275,9 @@ export const getLinkedFiles = async (
|
|||
try {
|
||||
const { tableName, recordId } = req.params;
|
||||
|
||||
console.log("📎 연결된 파일 조회 요청:", {
|
||||
tableName,
|
||||
recordId,
|
||||
});
|
||||
|
||||
// target_objid 생성 (테이블명:레코드ID 형식)
|
||||
const baseTargetObjid = `${tableName}:${recordId}`;
|
||||
|
||||
console.log("🔍 파일 조회 쿼리:", {
|
||||
tableName,
|
||||
recordId,
|
||||
baseTargetObjid,
|
||||
queryPattern: `${baseTargetObjid}%`,
|
||||
});
|
||||
|
||||
// 기본 target_objid와 파일 컬럼 패턴 모두 조회 (tableName:recordId% 패턴)
|
||||
const files = await prisma.attach_file_info.findMany({
|
||||
where: {
|
||||
|
|
@ -388,11 +291,6 @@ export const getLinkedFiles = async (
|
|||
},
|
||||
});
|
||||
|
||||
console.log("📁 조회된 파일 목록:", {
|
||||
foundFiles: files.length,
|
||||
targetObjids: files.map((f) => f.target_objid),
|
||||
});
|
||||
|
||||
const fileList = files.map((file: any) => ({
|
||||
objid: file.objid.toString(),
|
||||
savedFileName: file.saved_file_name,
|
||||
|
|
@ -409,11 +307,6 @@ export const getLinkedFiles = async (
|
|||
status: file.status,
|
||||
}));
|
||||
|
||||
console.log("✅ 연결된 파일 조회 완료:", {
|
||||
baseTargetObjid,
|
||||
fileCount: fileList.length,
|
||||
});
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
files: fileList,
|
||||
|
|
@ -440,12 +333,6 @@ export const getFileList = async (
|
|||
try {
|
||||
const { targetObjid, docType, companyCode } = req.query;
|
||||
|
||||
console.log("📋 파일 목록 조회 요청:", {
|
||||
targetObjid,
|
||||
docType,
|
||||
companyCode,
|
||||
});
|
||||
|
||||
const where: any = {
|
||||
status: "ACTIVE",
|
||||
};
|
||||
|
|
@ -506,8 +393,6 @@ export const previewFile = async (
|
|||
const { objid } = req.params;
|
||||
const { serverFilename } = req.query;
|
||||
|
||||
console.log("👁️ 파일 미리보기 요청:", { objid, serverFilename });
|
||||
|
||||
const fileRecord = await prisma.attach_file_info.findUnique({
|
||||
where: {
|
||||
objid: parseInt(objid),
|
||||
|
|
@ -539,13 +424,6 @@ export const previewFile = async (
|
|||
);
|
||||
const filePath = path.join(companyUploadDir, fileName);
|
||||
|
||||
console.log("👁️ 파일 미리보기 경로 확인:", {
|
||||
stored_file_path: fileRecord.file_path,
|
||||
company_code: companyCode,
|
||||
company_upload_dir: companyUploadDir,
|
||||
final_file_path: filePath,
|
||||
});
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
console.error("❌ 파일 없음:", filePath);
|
||||
res.status(404).json({
|
||||
|
|
@ -599,12 +477,6 @@ export const previewFile = async (
|
|||
// 파일 스트림으로 전송
|
||||
const fileStream = fs.createReadStream(filePath);
|
||||
fileStream.pipe(res);
|
||||
|
||||
console.log("✅ 파일 미리보기 완료:", {
|
||||
objid,
|
||||
fileName: fileRecord.real_file_name,
|
||||
mimeType,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("파일 미리보기 오류:", error);
|
||||
res.status(500).json({
|
||||
|
|
@ -624,8 +496,6 @@ export const downloadFile = async (
|
|||
try {
|
||||
const { objid } = req.params;
|
||||
|
||||
console.log("📥 파일 다운로드 요청:", { objid });
|
||||
|
||||
const fileRecord = await prisma.attach_file_info.findUnique({
|
||||
where: {
|
||||
objid: parseInt(objid),
|
||||
|
|
@ -658,13 +528,6 @@ export const downloadFile = async (
|
|||
);
|
||||
const filePath = path.join(companyUploadDir, fileName);
|
||||
|
||||
console.log("📥 파일 다운로드 경로 확인:", {
|
||||
stored_file_path: fileRecord.file_path,
|
||||
company_code: companyCode,
|
||||
company_upload_dir: companyUploadDir,
|
||||
final_file_path: filePath,
|
||||
});
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
console.error("❌ 파일 없음:", filePath);
|
||||
res.status(404).json({
|
||||
|
|
@ -684,11 +547,6 @@ export const downloadFile = async (
|
|||
// 파일 스트림 전송
|
||||
const fileStream = fs.createReadStream(filePath);
|
||||
fileStream.pipe(res);
|
||||
|
||||
console.log("✅ 파일 다운로드 시작:", {
|
||||
objid: fileRecord.objid.toString(),
|
||||
real_file_name: fileRecord.real_file_name,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("파일 다운로드 오류:", error);
|
||||
res.status(500).json({
|
||||
|
|
|
|||
|
|
@ -344,7 +344,6 @@ export const getTableInfo = async (
|
|||
return;
|
||||
}
|
||||
|
||||
console.log(`=== 테이블 정보 조회 API 호출: ${tableName} ===`);
|
||||
const tableInfo = await screenManagementService.getTableInfo(
|
||||
tableName,
|
||||
companyCode
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ export function RegistryProvider({ children }: RegistryProviderProps) {
|
|||
try {
|
||||
initializeRegistries();
|
||||
setIsInitialized(true);
|
||||
console.log("✅ 레지스트리 초기화 완료");
|
||||
} catch (error) {
|
||||
console.error("❌ 레지스트리 초기화 실패:", error);
|
||||
setIsInitialized(true); // 오류가 있어도 앱은 계속 실행
|
||||
|
|
@ -60,5 +59,3 @@ export function useRegistryInitialization() {
|
|||
|
||||
return { isInitialized, error };
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ export function MenuProvider({ children }: { children: ReactNode }) {
|
|||
const loadMenus = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
console.log("=== MenuContext API 호출 시작 ===");
|
||||
|
||||
// 사용자 로케일이 로드될 때까지 잠시 대기
|
||||
let retryCount = 0;
|
||||
|
|
@ -59,12 +58,10 @@ export function MenuProvider({ children }: { children: ReactNode }) {
|
|||
const hasStoredLang = !!localStorage.getItem("userLocale");
|
||||
|
||||
if (hasGlobalLang || hasStoredLang) {
|
||||
console.log("✅ 사용자 로케일 로드 완료, 메뉴 API 호출 진행");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`⏳ 사용자 로케일 로드 대기 중... (${retryCount + 1}/${maxRetries})`);
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
retryCount++;
|
||||
}
|
||||
|
|
@ -76,22 +73,15 @@ export function MenuProvider({ children }: { children: ReactNode }) {
|
|||
// 관리자 메뉴와 사용자 메뉴를 병렬로 로드
|
||||
const [adminResponse, userResponse] = await Promise.all([menuApi.getAdminMenus(), menuApi.getUserMenus()]);
|
||||
|
||||
console.log("관리자 메뉴 응답:", adminResponse);
|
||||
console.log("사용자 메뉴 응답:", userResponse);
|
||||
|
||||
if (adminResponse.success && adminResponse.data) {
|
||||
const convertedAdminMenus = convertMenuData(adminResponse.data);
|
||||
setAdminMenus(convertedAdminMenus);
|
||||
console.log("관리자 메뉴 변환 완료:", convertedAdminMenus.length, "개");
|
||||
}
|
||||
|
||||
if (userResponse.success && userResponse.data) {
|
||||
const convertedUserMenus = convertMenuData(userResponse.data);
|
||||
setUserMenus(convertedUserMenus);
|
||||
console.log("사용자 메뉴 변환 완료:", convertedUserMenus.length, "개");
|
||||
}
|
||||
|
||||
console.log("메뉴 로딩 완료");
|
||||
} catch (error) {
|
||||
console.error("메뉴 로드 오류:", error);
|
||||
toast.error("메뉴 목록을 불러오는데 실패했습니다.");
|
||||
|
|
|
|||
|
|
@ -107,19 +107,14 @@ export const useAuth = () => {
|
|||
*/
|
||||
const fetchCurrentUser = useCallback(async (): Promise<UserInfo | null> => {
|
||||
try {
|
||||
console.log("=== fetchCurrentUser 시작 ===");
|
||||
const response = await apiCall<UserInfo>("GET", "/auth/me");
|
||||
console.log("fetchCurrentUser 응답:", response);
|
||||
|
||||
if (response.success && response.data) {
|
||||
console.log("사용자 정보 조회 성공:", response.data);
|
||||
|
||||
// 사용자 로케일 정보도 함께 조회하여 전역 저장
|
||||
try {
|
||||
const localeResponse = await apiCall<string>("GET", "/admin/user-locale");
|
||||
if (localeResponse.success && localeResponse.data) {
|
||||
const userLocale = localeResponse.data;
|
||||
console.log("✅ 사용자 로케일 조회 성공:", userLocale);
|
||||
|
||||
// 전역 상태에 저장 (다른 컴포넌트에서 사용)
|
||||
(window as any).__GLOBAL_USER_LANG = userLocale;
|
||||
|
|
@ -128,8 +123,6 @@ export const useAuth = () => {
|
|||
// localStorage에도 저장 (새 창에서 공유)
|
||||
localStorage.setItem("userLocale", userLocale);
|
||||
localStorage.setItem("userLocaleLoaded", "true");
|
||||
|
||||
console.log("🌐 전역 사용자 로케일 저장됨:", userLocale);
|
||||
}
|
||||
} catch (localeError) {
|
||||
console.warn("⚠️ 사용자 로케일 조회 실패, 기본값 사용:", localeError);
|
||||
|
|
@ -144,7 +137,6 @@ export const useAuth = () => {
|
|||
return response.data;
|
||||
}
|
||||
|
||||
console.log("사용자 정보 조회 실패 - 응답이 없음");
|
||||
return null;
|
||||
} catch (error) {
|
||||
console.error("사용자 정보 조회 실패:", error);
|
||||
|
|
@ -157,26 +149,16 @@ export const useAuth = () => {
|
|||
*/
|
||||
const checkAuthStatus = useCallback(async (): Promise<AuthStatus> => {
|
||||
try {
|
||||
console.log("=== checkAuthStatus 시작 ===");
|
||||
const response = await apiCall<AuthStatus>("GET", "/auth/status");
|
||||
console.log("checkAuthStatus 응답:", response);
|
||||
console.log("checkAuthStatus 응답.data:", response.data);
|
||||
console.log("checkAuthStatus 응답.data.isLoggedIn:", response.data?.isLoggedIn);
|
||||
console.log("checkAuthStatus 응답.data.isAuthenticated:", (response.data as any)?.isAuthenticated);
|
||||
|
||||
if (response.success && response.data) {
|
||||
console.log("인증 상태 확인 성공:", response.data);
|
||||
|
||||
// 백엔드에서 isAuthenticated를 반환하므로 isLoggedIn으로 매핑
|
||||
const mappedData = {
|
||||
isLoggedIn: (response.data as any).isAuthenticated || response.data.isLoggedIn || false,
|
||||
isAdmin: response.data.isAdmin || false,
|
||||
};
|
||||
console.log("매핑된 인증 상태:", mappedData);
|
||||
return mappedData;
|
||||
}
|
||||
|
||||
console.log("인증 상태 확인 실패 - 응답이 없음");
|
||||
return {
|
||||
isLoggedIn: false,
|
||||
isAdmin: false,
|
||||
|
|
@ -202,16 +184,12 @@ export const useAuth = () => {
|
|||
if (!token) {
|
||||
setUser(null);
|
||||
setAuthStatus({ isLoggedIn: false, isAdmin: false });
|
||||
console.log("토큰이 없음 - 3초 후 로그인 페이지로 리다이렉트");
|
||||
setTimeout(() => {
|
||||
router.push("/login");
|
||||
}, 3000);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("=== refreshUserData 디버깅 ===");
|
||||
console.log("토큰 존재:", !!token);
|
||||
|
||||
// 토큰이 있으면 임시로 인증된 상태로 설정
|
||||
setAuthStatus({
|
||||
isLoggedIn: true,
|
||||
|
|
@ -222,10 +200,6 @@ export const useAuth = () => {
|
|||
// 병렬로 사용자 정보와 인증 상태 조회
|
||||
const [userInfo, authStatusData] = await Promise.all([fetchCurrentUser(), checkAuthStatus()]);
|
||||
|
||||
console.log("userInfo:", userInfo);
|
||||
console.log("authStatusData:", authStatusData);
|
||||
console.log("authStatusData.isLoggedIn:", authStatusData?.isLoggedIn);
|
||||
|
||||
setUser(userInfo);
|
||||
|
||||
// 관리자 권한 확인 로직 개선
|
||||
|
|
@ -237,46 +211,27 @@ export const useAuth = () => {
|
|||
isLoggedIn: authStatusData.isLoggedIn,
|
||||
isAdmin: authStatusData.isAdmin || isAdminFromUser,
|
||||
};
|
||||
console.log("관리자 권한 확인:", {
|
||||
userId: userInfo.userId,
|
||||
userType: userInfo.userType,
|
||||
isAdminFromAuth: authStatusData.isAdmin,
|
||||
isAdminFromUser: isAdminFromUser,
|
||||
finalIsAdmin: finalAuthStatus.isAdmin,
|
||||
});
|
||||
}
|
||||
|
||||
setAuthStatus(finalAuthStatus);
|
||||
|
||||
// 디버깅용 로그
|
||||
if (userInfo) {
|
||||
console.log("사용자 정보 업데이트:", {
|
||||
userId: userInfo.userId,
|
||||
userName: userInfo.userName,
|
||||
hasPhoto: !!userInfo.photo,
|
||||
photoStart: userInfo.photo ? userInfo.photo.substring(0, 50) + "..." : "null",
|
||||
});
|
||||
}
|
||||
|
||||
// 로그인되지 않은 상태인 경우 토큰 제거 (리다이렉트는 useEffect에서 처리)
|
||||
if (!finalAuthStatus.isLoggedIn) {
|
||||
console.log("로그인되지 않은 상태 - 사용자 정보 제거");
|
||||
TokenManager.removeToken();
|
||||
setUser(null);
|
||||
setAuthStatus({ isLoggedIn: false, isAdmin: false });
|
||||
} else {
|
||||
console.log("로그인된 상태 - 사용자 정보 유지");
|
||||
}
|
||||
} catch (apiError) {
|
||||
console.error("API 호출 실패:", apiError);
|
||||
|
||||
// API 호출 실패 시에도 토큰이 있으면 임시로 인증된 상태로 처리
|
||||
console.log("API 호출 실패했지만 토큰이 존재하므로 임시로 인증된 상태로 처리");
|
||||
|
||||
// 토큰에서 사용자 정보 추출 시도
|
||||
try {
|
||||
const payload = JSON.parse(atob(token.split(".")[1]));
|
||||
console.log("토큰 페이로드:", payload);
|
||||
|
||||
const tempUser = {
|
||||
userId: payload.userId || "unknown",
|
||||
|
|
@ -289,15 +244,12 @@ export const useAuth = () => {
|
|||
isLoggedIn: true,
|
||||
isAdmin: tempUser.isAdmin,
|
||||
});
|
||||
|
||||
console.log("임시 사용자 정보 설정:", tempUser);
|
||||
} catch (tokenError) {
|
||||
console.error("토큰 파싱 실패:", tokenError);
|
||||
// 토큰 파싱도 실패하면 로그인 페이지로 리다이렉트
|
||||
TokenManager.removeToken();
|
||||
setUser(null);
|
||||
setAuthStatus({ isLoggedIn: false, isAdmin: false });
|
||||
console.log("토큰 파싱 실패 - 3초 후 로그인 페이지로 리다이렉트");
|
||||
setTimeout(() => {
|
||||
router.push("/login");
|
||||
}, 3000);
|
||||
|
|
@ -311,7 +263,6 @@ export const useAuth = () => {
|
|||
TokenManager.removeToken();
|
||||
setUser(null);
|
||||
setAuthStatus({ isLoggedIn: false, isAdmin: false });
|
||||
console.log("사용자 데이터 새로고침 실패 - 3초 후 로그인 페이지로 리다이렉트");
|
||||
setTimeout(() => {
|
||||
router.push("/login");
|
||||
}, 3000);
|
||||
|
|
@ -451,22 +402,15 @@ export const useAuth = () => {
|
|||
|
||||
initializedRef.current = true;
|
||||
|
||||
console.log("=== useAuth 초기 인증 상태 확인 ===");
|
||||
console.log("현재 경로:", window.location.pathname);
|
||||
|
||||
// 로그인 페이지에서는 인증 상태 확인하지 않음
|
||||
if (window.location.pathname === "/login") {
|
||||
console.log("로그인 페이지 - 인증 상태 확인 건너뜀");
|
||||
return;
|
||||
}
|
||||
|
||||
// 토큰이 있는 경우에만 인증 상태 확인
|
||||
const token = TokenManager.getToken();
|
||||
console.log("localStorage 토큰:", token ? "존재" : "없음");
|
||||
|
||||
if (token && !TokenManager.isTokenExpired(token)) {
|
||||
console.log("유효한 토큰 존재 - 사용자 데이터 새로고침");
|
||||
|
||||
// 토큰이 있으면 임시로 인증된 상태로 설정 (API 호출 전에)
|
||||
setAuthStatus({
|
||||
isLoggedIn: true,
|
||||
|
|
@ -475,13 +419,11 @@ export const useAuth = () => {
|
|||
|
||||
refreshUserData();
|
||||
} else if (!token) {
|
||||
console.log("토큰이 없음 - 3초 후 로그인 페이지로 리다이렉트");
|
||||
// 토큰이 없으면 3초 후 로그인 페이지로 리다이렉트
|
||||
setTimeout(() => {
|
||||
router.push("/login");
|
||||
}, 3000);
|
||||
} else {
|
||||
console.log("토큰 만료 - 3초 후 로그인 페이지로 리다이렉트");
|
||||
TokenManager.removeToken();
|
||||
setTimeout(() => {
|
||||
router.push("/login");
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ export const useLogin = () => {
|
|||
localStorage.setItem("authToken", result.data.token);
|
||||
|
||||
// 로그인 성공
|
||||
console.log("로그인 성공:", result.message || "로그인에 성공했습니다.");
|
||||
router.push(AUTH_CONFIG.ROUTES.MAIN);
|
||||
} else {
|
||||
// 로그인 실패
|
||||
|
|
|
|||
|
|
@ -2,38 +2,28 @@ import axios, { AxiosResponse, AxiosError } from "axios";
|
|||
|
||||
// API URL 동적 설정 - 환경별 명확한 분리
|
||||
const getApiBaseUrl = (): string => {
|
||||
console.log("🔍 API URL 결정 시작!");
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
const currentHost = window.location.hostname;
|
||||
const currentPort = window.location.port;
|
||||
const fullUrl = window.location.href;
|
||||
|
||||
console.log("🌐 현재 접속 정보:", {
|
||||
hostname: currentHost,
|
||||
fullUrl: fullUrl,
|
||||
port: currentPort,
|
||||
});
|
||||
|
||||
// 로컬 개발환경: localhost:9771 또는 localhost:3000 → localhost:8080
|
||||
if ((currentHost === "localhost" || currentHost === "127.0.0.1") && (currentPort === "9771" || currentPort === "3000")) {
|
||||
console.log("🏠 로컬 개발 환경 감지 → localhost:8080/api");
|
||||
if (
|
||||
(currentHost === "localhost" || currentHost === "127.0.0.1") &&
|
||||
(currentPort === "9771" || currentPort === "3000")
|
||||
) {
|
||||
return "http://localhost:8080/api";
|
||||
}
|
||||
|
||||
// 서버 환경에서 localhost:5555 → 39.117.244.52:8080
|
||||
if ((currentHost === "localhost" || currentHost === "127.0.0.1") && currentPort === "5555") {
|
||||
console.log("🌍 서버 환경 (localhost:5555) 감지 → 39.117.244.52:8080/api");
|
||||
return "http://39.117.244.52:8080/api";
|
||||
}
|
||||
|
||||
// 기타 서버 환경 (내부/외부 IP): → 39.117.244.52:8080
|
||||
console.log("🌍 서버 환경 감지 → 39.117.244.52:8080/api");
|
||||
return "http://39.117.244.52:8080/api";
|
||||
}
|
||||
|
||||
// 서버 사이드 렌더링 기본값
|
||||
console.log("🖥️ SSR 기본값 → 39.117.244.52:8080/api");
|
||||
return "http://39.117.244.52:8080/api";
|
||||
};
|
||||
|
||||
|
|
@ -73,18 +63,9 @@ apiClient.interceptors.request.use(
|
|||
(config) => {
|
||||
// JWT 토큰 추가
|
||||
const token = TokenManager.getToken();
|
||||
console.log("🔍 API 요청 토큰 확인:", {
|
||||
hasToken: !!token,
|
||||
tokenLength: token ? token.length : 0,
|
||||
tokenStart: token ? token.substring(0, 30) + "..." : "없음",
|
||||
url: config.url,
|
||||
method: config.method,
|
||||
});
|
||||
|
||||
if (token && !TokenManager.isTokenExpired(token)) {
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
console.log("✅ JWT 토큰 추가됨:", token.substring(0, 50) + "...");
|
||||
console.log("🔑 Authorization 헤더:", `Bearer ${token.substring(0, 30)}...`);
|
||||
} else if (token && TokenManager.isTokenExpired(token)) {
|
||||
console.warn("❌ 토큰이 만료되었습니다.");
|
||||
// 토큰 제거
|
||||
|
|
@ -97,7 +78,6 @@ apiClient.interceptors.request.use(
|
|||
|
||||
// FormData 요청 시 Content-Type 자동 처리
|
||||
if (config.data instanceof FormData) {
|
||||
console.log("📎 FormData 감지 - Content-Type 헤더 제거");
|
||||
delete config.headers["Content-Type"];
|
||||
}
|
||||
|
||||
|
|
@ -120,13 +100,6 @@ apiClient.interceptors.request.use(
|
|||
}
|
||||
}
|
||||
|
||||
console.log("🌐 API 요청 시 언어 정보:", {
|
||||
currentLang,
|
||||
globalVar: (window as unknown as { __GLOBAL_USER_LANG?: string }).__GLOBAL_USER_LANG,
|
||||
localStorage: typeof window !== "undefined" ? localStorage.getItem("userLocale") : null,
|
||||
url: config.url,
|
||||
});
|
||||
|
||||
if (config.params) {
|
||||
config.params.userLang = currentLang;
|
||||
} else {
|
||||
|
|
@ -134,8 +107,6 @@ apiClient.interceptors.request.use(
|
|||
}
|
||||
}
|
||||
|
||||
console.log("📡 API 요청:", config.method?.toUpperCase(), config.url, config.params, config.data);
|
||||
console.log("📋 요청 헤더:", config.headers);
|
||||
return config;
|
||||
},
|
||||
(error) => {
|
||||
|
|
@ -147,7 +118,6 @@ apiClient.interceptors.request.use(
|
|||
// 응답 인터셉터
|
||||
apiClient.interceptors.response.use(
|
||||
(response: AxiosResponse) => {
|
||||
console.log("✅ API 응답:", response.status, response.config.url, response.data);
|
||||
return response;
|
||||
},
|
||||
(error: AxiosError) => {
|
||||
|
|
@ -194,7 +164,6 @@ apiClient.interceptors.response.use(
|
|||
|
||||
// 401 에러 시 토큰 제거 및 로그인 페이지로 리다이렉트
|
||||
if (status === 401 && typeof window !== "undefined") {
|
||||
console.log("🔄 401 에러 감지 - 토큰 제거 및 로그인 페이지로 리다이렉트");
|
||||
localStorage.removeItem("authToken");
|
||||
|
||||
// 로그인 페이지가 아닌 경우에만 리다이렉트
|
||||
|
|
|
|||
|
|
@ -79,12 +79,7 @@ export const menuApi = {
|
|||
// 관리자 메뉴 목록 조회
|
||||
getAdminMenus: async (): Promise<ApiResponse<MenuItem[]>> => {
|
||||
const response = await apiClient.get("/admin/menus");
|
||||
console.log("=== API 응답 데이터 ===");
|
||||
console.log("전체 응답:", response);
|
||||
console.log("응답 데이터:", response.data);
|
||||
if (response.data.success && response.data.data && response.data.data.length > 0) {
|
||||
console.log("첫 번째 메뉴 원본 데이터:", response.data.data[0]);
|
||||
console.log("첫 번째 메뉴 키들:", Object.keys(response.data.data[0]));
|
||||
}
|
||||
return response.data;
|
||||
},
|
||||
|
|
@ -145,12 +140,9 @@ export const menuApi = {
|
|||
menuCode?: string;
|
||||
keyType?: string;
|
||||
}): Promise<ApiResponse<LangKey[]>> => {
|
||||
console.log("🔍 다국어 키 목록 조회 API 호출:", "/multilang/keys", params);
|
||||
|
||||
try {
|
||||
// Node.js 백엔드의 실제 라우팅과 일치하도록 수정
|
||||
const response = await apiClient.get("/multilang/keys", { params });
|
||||
console.log("✅ 다국어 키 목록 조회 성공:", response.data);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error("❌ 다국어 키 목록 조회 실패:", error);
|
||||
|
|
|
|||
|
|
@ -317,7 +317,6 @@ export class ComponentRegistry {
|
|||
static clear(): void {
|
||||
this.components.clear();
|
||||
this.eventListeners.length = 0;
|
||||
console.log("🧹 컴포넌트 레지스트리 초기화 완료");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ class LegacyComponentRegistry {
|
|||
// 컴포넌트 렌더러 등록
|
||||
register(componentType: string, renderer: ComponentRenderer) {
|
||||
this.renderers.set(componentType, renderer);
|
||||
console.log(`🔧 레거시 컴포넌트 렌더러 등록: ${componentType}`);
|
||||
}
|
||||
|
||||
// 컴포넌트 렌더러 조회
|
||||
|
|
@ -51,11 +50,6 @@ class LegacyComponentRegistry {
|
|||
// 컴포넌트 타입이 등록되어 있는지 확인
|
||||
has(componentType: string): boolean {
|
||||
const result = this.renderers.has(componentType);
|
||||
console.log(`🔍 LegacyComponentRegistry.has("${componentType}"):`, {
|
||||
result,
|
||||
availableKeys: Array.from(this.renderers.keys()),
|
||||
mapSize: this.renderers.size,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -94,17 +88,6 @@ export const DynamicComponentRenderer: React.FC<DynamicComponentRendererProps> =
|
|||
// 컴포넌트 타입 추출 - 새 시스템에서는 componentType 속성 사용, 레거시는 type 사용
|
||||
const componentType = (component as any).componentType || component.type;
|
||||
|
||||
console.log("🔍 컴포넌트 타입 추출:", {
|
||||
componentId: component.id,
|
||||
componentConfigType: component.componentConfig?.type,
|
||||
componentType: component.type,
|
||||
componentTypeProp: (component as any).componentType,
|
||||
finalComponentType: componentType,
|
||||
componentConfig: component.componentConfig,
|
||||
propsScreenId: props.screenId,
|
||||
propsTableName: props.tableName,
|
||||
});
|
||||
|
||||
// 레이아웃 컴포넌트 처리
|
||||
if (componentType === "layout") {
|
||||
return (
|
||||
|
|
@ -123,52 +106,16 @@ export const DynamicComponentRenderer: React.FC<DynamicComponentRendererProps> =
|
|||
);
|
||||
}
|
||||
|
||||
console.log("🎯 DynamicComponentRenderer:", {
|
||||
componentId: component.id,
|
||||
componentType,
|
||||
componentConfig: component.componentConfig,
|
||||
newSystemRegistered: ComponentRegistry.getAllComponents().map((c) => c.id),
|
||||
legacySystemRegistered: legacyComponentRegistry.getRegisteredTypes(),
|
||||
hasLegacyRenderer: legacyComponentRegistry.has(componentType),
|
||||
actualLegacyRenderer: legacyComponentRegistry.get(componentType),
|
||||
legacyMapSize: legacyComponentRegistry.getRegisteredTypes().length,
|
||||
});
|
||||
|
||||
// 1. 새 컴포넌트 시스템에서 먼저 조회
|
||||
const newComponent = ComponentRegistry.getComponent(componentType);
|
||||
console.log("🔍 새 컴포넌트 시스템 조회:", {
|
||||
componentType,
|
||||
found: !!newComponent,
|
||||
component: newComponent,
|
||||
registeredTypes: ComponentRegistry.getAllComponents().map((c) => c.id),
|
||||
});
|
||||
|
||||
if (newComponent) {
|
||||
console.log("✨ 새 컴포넌트 시스템에서 발견:", componentType);
|
||||
|
||||
// 새 컴포넌트 시스템으로 렌더링
|
||||
try {
|
||||
const NewComponentRenderer = newComponent.component;
|
||||
if (NewComponentRenderer) {
|
||||
console.log("🔧 컴포넌트 렌더링 props:", {
|
||||
componentType,
|
||||
componentId: component.id,
|
||||
screenId: props.screenId,
|
||||
tableName: props.tableName,
|
||||
onRefresh: !!props.onRefresh,
|
||||
onClose: !!props.onClose,
|
||||
});
|
||||
// React 전용 props 필터링
|
||||
const {
|
||||
isInteractive,
|
||||
formData,
|
||||
onFormDataChange,
|
||||
selectedScreen,
|
||||
onZoneComponentDrop,
|
||||
onZoneClick,
|
||||
componentConfig,
|
||||
...safeProps
|
||||
} = props;
|
||||
const { isInteractive, formData, onFormDataChange, ...safeProps } = props;
|
||||
|
||||
return (
|
||||
<NewComponentRenderer
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ export class WebTypeRegistry {
|
|||
data: definition,
|
||||
timestamp: new Date(),
|
||||
});
|
||||
console.log(`✅ 웹타입 등록: ${definition.id} (${definition.name})`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -42,7 +41,6 @@ export class WebTypeRegistry {
|
|||
data: definition,
|
||||
timestamp: new Date(),
|
||||
});
|
||||
console.log(`❌ 웹타입 등록 해제: ${id}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -129,7 +127,6 @@ export class WebTypeRegistry {
|
|||
data: definition,
|
||||
timestamp: new Date(),
|
||||
});
|
||||
console.log(`✅ 버튼 액션 등록: ${definition.id} (${definition.name})`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -144,7 +141,6 @@ export class WebTypeRegistry {
|
|||
data: definition,
|
||||
timestamp: new Date(),
|
||||
});
|
||||
console.log(`❌ 버튼 액션 등록 해제: ${id}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -246,7 +242,6 @@ export class WebTypeRegistry {
|
|||
this.webTypes.clear();
|
||||
this.buttonActions.clear();
|
||||
this.eventListeners.length = 0;
|
||||
console.log("🧹 레지스트리 초기화됨");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -279,5 +274,3 @@ export class WebTypeRegistry {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -386,8 +386,6 @@ export function initializeWebTypeRegistry() {
|
|||
},
|
||||
isActive: true,
|
||||
});
|
||||
|
||||
console.log("웹타입 레지스트리 초기화 완료:", WebTypeRegistry.getAllWebTypes().length, "개 웹타입 등록됨");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -44,8 +44,6 @@ export class SessionManager {
|
|||
this.checkTimer = setInterval(() => {
|
||||
this.checkSession();
|
||||
}, this.config.checkInterval);
|
||||
|
||||
console.log("세션 모니터링 시작됨");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -63,7 +61,6 @@ export class SessionManager {
|
|||
}
|
||||
|
||||
this.removeActivityListeners();
|
||||
console.log("세션 모니터링 중지됨");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -119,7 +116,6 @@ export class SessionManager {
|
|||
* 세션 만료 처리
|
||||
*/
|
||||
private handleSessionExpiry() {
|
||||
console.log("세션이 만료되었습니다");
|
||||
this.stop();
|
||||
this.callbacks.onExpiry?.();
|
||||
}
|
||||
|
|
@ -244,7 +240,6 @@ export const tokenSync = {
|
|||
// 토큰 상태 확인
|
||||
checkToken: () => {
|
||||
const token = localStorage.getItem("authToken");
|
||||
console.log("🔍 토큰 상태 확인:", token ? "존재" : "없음");
|
||||
return !!token;
|
||||
},
|
||||
|
||||
|
|
@ -254,7 +249,6 @@ export const tokenSync = {
|
|||
if (token) {
|
||||
// sessionStorage에도 복사
|
||||
sessionStorage.setItem("authToken", token);
|
||||
console.log("🔄 토큰 강제 동기화 완료");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -265,7 +259,6 @@ export const tokenSync = {
|
|||
const sessionToken = sessionStorage.getItem("authToken");
|
||||
if (sessionToken) {
|
||||
localStorage.setItem("authToken", sessionToken);
|
||||
console.log("🔄 sessionStorage에서 토큰 복원 완료");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -286,14 +279,11 @@ export const tokenSync = {
|
|||
|
||||
// 만료 시간 확인
|
||||
if (payload.exp && payload.exp < now) {
|
||||
console.log("❌ 토큰 만료됨");
|
||||
return false;
|
||||
}
|
||||
|
||||
console.log("✅ 토큰 유효성 검증 통과");
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.log("❌ 토큰 유효성 검증 실패:", error);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue