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 %>" + ); 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 @@