Mukho

Fix

...@@ -61,7 +61,7 @@ create table board( ...@@ -61,7 +61,7 @@ create table board(
61 >UPDATE board SET idx = @COUNT:=@COUNT+1; 61 >UPDATE board SET idx = @COUNT:=@COUNT+1;
62 62
63 --- 63 ---
64 -### 최종 수정: 2021-11-25 14:05<br> 64 +### 최종 수정: 2021-11-25 14:15<br>
65 ### 수정 내용: 65 ### 수정 내용:
66 0. 채팅기능에 버그가 있는 것 같음(undefined님이 나가셨습니다. -> 콘솔에 계속 출력됨) // socket.io의 express-session 호환 문제로 후순위 개발로 미룸 66 0. 채팅기능에 버그가 있는 것 같음(undefined님이 나가셨습니다. -> 콘솔에 계속 출력됨) // socket.io의 express-session 호환 문제로 후순위 개발로 미룸
67 1. 로그에 시간/IP 추가 67 1. 로그에 시간/IP 추가
......
...@@ -224,6 +224,8 @@ router.get('/upload', function(req,res){ ...@@ -224,6 +224,8 @@ router.get('/upload', function(req,res){
224 var ip = requestIp.getClientIp(req); 224 var ip = requestIp.getClientIp(req);
225 try{ 225 try{
226 var id = req.user.ID; 226 var id = req.user.ID;
227 + var nickname = req.user.nickname;
228 + console.log(logString+req.user.ID+'('+nickname+') 유저가 프로필 열람 중입니다.('+ip+')')
227 if(id) res.render('uploadprof.ejs') 229 if(id) res.render('uploadprof.ejs')
228 } 230 }
229 catch{ 231 catch{
...@@ -253,7 +255,7 @@ router.post('/upload', upload.single('userfile'), function(req,res){ ...@@ -253,7 +255,7 @@ router.post('/upload', upload.single('userfile'), function(req,res){
253 catch{ 255 catch{
254 if(!id){ 256 if(!id){
255 console.log(logString+'익명 유저의 프로필 사진 업로드 시도를 거부했습니다.('+ip+')') 257 console.log(logString+'익명 유저의 프로필 사진 업로드 시도를 거부했습니다.('+ip+')')
256 - res.sendFile(path.join(__dirname, "../../public/login.html")) 258 + res.send("<script>alert('로그인이 필요합니다.');opener.location.href='/login';window.close();</script>");
257 } 259 }
258 else{ 260 else{
259 console.log(logString+req.user.ID+'('+req.user.nickname+') 유저가 파일 업로드 없이 업로드를 시도했습니다.('+ip+')') 261 console.log(logString+req.user.ID+'('+req.user.nickname+') 유저가 파일 업로드 없이 업로드를 시도했습니다.('+ip+')')
......