From abae1e47bedb804b668fa1e3728a23d339715555 Mon Sep 17 00:00:00 2001 From: Ungs Date: Mon, 5 Jun 2023 12:27:07 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat=20:=20=EC=B5=9C=EA=B7=BC=EB=B3=B8=20?= =?UTF-8?q?=EC=9E=91=ED=92=88=20=EC=9D=B4=EC=96=B4=EB=B3=B4=EA=B8=B0=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/home.js | 3 +++ src/views/home/welcome.ejs | 1 + src/views/novels/index.ejs | 19 +++++++++++++++++-- src/views/posts/viewer.ejs | 21 +++++++++++++-------- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/controllers/home.js b/src/controllers/home.js index 1c04453..d92a1dd 100644 --- a/src/controllers/home.js +++ b/src/controllers/home.js @@ -31,4 +31,7 @@ Router.post("/upload", ImageServices.upload.single("upload"), (req, res) => { res.send(req.file); }); +Router.get("/session", function (req, res) { + res.send(req.session); +}); export default Router; diff --git a/src/views/home/welcome.ejs b/src/views/home/welcome.ejs index 0c46dee..19033ff 100644 --- a/src/views/home/welcome.ejs +++ b/src/views/home/welcome.ejs @@ -51,6 +51,7 @@

랭킹

<% novel.forEach(function(post,idx){ %> + <% if(idx >3) return; %>
Card image cap
diff --git a/src/views/novels/index.ejs b/src/views/novels/index.ejs index 157c9e6..de54488 100644 --- a/src/views/novels/index.ejs +++ b/src/views/novels/index.ejs @@ -83,9 +83,10 @@
- 연재 목록 + 이어보기
-
공지
총 <%= novel.post.length %>화 @@ -215,5 +216,19 @@ $(".look").toggleClass("look_chk"); $("#look_post").toggleClass("flex-column-reverse"); }); + + $("#storage").click(function () { + if ( + localStorage.getItem("<%= currentUser.id %>" + "_" + "<%= novel.id %>") + ) { + location.href = + "/posts/view/" + + localStorage.getItem( + "<%= currentUser.id %>" + "_" + "<%= novel.id %>" + ); + } else { + alert("최근 본 화가 없습니다."); + } + }); diff --git a/src/views/posts/viewer.ejs b/src/views/posts/viewer.ejs index ceb232e..3e55b8e 100644 --- a/src/views/posts/viewer.ejs +++ b/src/views/posts/viewer.ejs @@ -260,14 +260,14 @@ } }); /* - $(".line").click(function () { - $("#cite").text($(this).text()); - $(".chat_box").fadeIn(); - }); - $(document).mouseup(function () { - $(".chat_box").fadeOut(); - }); -*/ + $(".line").click(function () { + $("#cite").text($(this).text()); + $(".chat_box").fadeIn(); + }); + $(document).mouseup(function () { + $(".chat_box").fadeOut(); + }); + */ $(document).mouseup(function () { $(".move_box").fadeOut(); }); @@ -309,5 +309,10 @@ $("#ok_move").click(function () { $("#move_form").submit(); }); + + window.localStorage.setItem( + "<%= currentUser.id %>" + "_" + "<%= post.novel.id %>", + "<%= post.id %>" + ); From 2af261bba264eb58ac6db9c6538ef9e384ef4b67 Mon Sep 17 00:00:00 2001 From: Ungs Date: Thu, 8 Jun 2023 16:39:35 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20=EC=9C=A0=ED=9A=A8?= =?UTF-8?q?=EC=84=B1=20=EA=B2=80=EC=82=AC=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/user/login.ejs | 6 ++++++ src/views/user/signup.ejs | 32 +++++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/views/user/login.ejs b/src/views/user/login.ejs index ba5c98b..d07ee8a 100644 --- a/src/views/user/login.ejs +++ b/src/views/user/login.ejs @@ -20,6 +20,8 @@ id="password" name="password" placeholder="비밀번호" + pattern="^[a-zA-Z0-9가-힣]{8,}$" + title="특수문자를 제외한 문자 8이상으로 작성하시오." required /> @@ -47,6 +51,8 @@ id="password" name="password" placeholder="비밀번호" + pattern="^[a-zA-Z0-9가-힣]{8,}$" + title="특수문자를 제외한 문자 8이상으로 작성하시오." required /> diff --git a/src/views/user/signup.ejs b/src/views/user/signup.ejs index 4ceb487..f87ada7 100644 --- a/src/views/user/signup.ejs +++ b/src/views/user/signup.ejs @@ -6,19 +6,31 @@