diff --git a/app.js b/app.js index 4decc57..6fc1add 100644 --- a/app.js +++ b/app.js @@ -3,8 +3,12 @@ const fs = require('fs'); const url = require('url'); const path = require('path'); const db = require('./db.js'); +const session = require('express-session'); + const mainRouter = require('./routes/main.js'); const loginRouter = require('./routes/login.js'); +const loginProcessRouter = require('./routes/login_process.js'); +const logoutProcessRouter = require('./routes/logout_process.js'); const signupRouter = require('./routes/signup.js'); const signupProcessRouter = require('./routes/signup_process.js'); @@ -43,7 +47,19 @@ app.use(express.static('public')); app.use('/', mainRouter); +app.use(express.static('public')); +app.use(session({ + key:'my key', + secret: 'secret', + resave: false, + saveUninitialize: true, + cookie:{ + maxAge: 60 * 60 * 24 * 1 + } +})); app.get('/login', loginRouter); +app.post('/login_process',loginProcessRouter); +app.get('/logout_process',logoutProcessRouter); app.get('/signup', signupRouter); app.post('/signup_process', signupProcessRouter); diff --git a/lib/author.js b/lib/author.js new file mode 100644 index 0000000..39cfc5b --- /dev/null +++ b/lib/author.js @@ -0,0 +1,16 @@ +module.exports = { + isOwner:function(request, response) { + if (request.session.is_logined) { + return true; + } else { + return false; + } + }, + statusUI:function(request, response) { + var authStatusUI = '로그인' + if (this.isOwner(request, response)) { + authStatusUI = `| 로그아웃`; + } + return authStatusUI; + } +} \ No newline at end of file diff --git a/lib/template.js b/lib/template.js index e9f296c..897c9e4 100644 --- a/lib/template.js +++ b/lib/template.js @@ -1,5 +1,5 @@ module.exports = { - HTML: function (title, head, body) { + HTML: function (title, head, body, authStatusUI = '로그인') { return ` @@ -66,7 +66,7 @@ module.exports = { + `; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }) }); diff --git a/routes/community/main_req.js b/routes/community/main_req.js index 1935b35..0aef7c2 100644 --- a/routes/community/main_req.js +++ b/routes/community/main_req.js @@ -1,21 +1,36 @@ var express = require('express'); var router = express.Router(); var template = require('../../lib/template.js'); +var author = require('../../lib/author.js'); const db = require('../../db.js'); router.get('/community/requirement', function (request, response) { - db.query(`SELECT * FROM requirement`, function(err, res){ + db.query(`SELECT * FROM requirement`, function (err, res) { var title = 'FORME에게 바란다.'; var head = ` `; var list = ''; var i = 0; - while(i < res.length) { + while (i < res.length) { list += ` ${res[i].id} @@ -29,22 +44,31 @@ router.get('/community/requirement', function (request, response) { i++; } var body = ` -
-
- 글쓰기 - - - - - - - +
+
+
+
+ +


+
No.Title.WriterDate
+ + + + + + + ${list} -
No제목.작성자작성일
-
-
+ +
+ + + + + + `; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }) }); diff --git a/routes/community/page_rec.js b/routes/community/page_rec.js index 5d50208..4f9225b 100644 --- a/routes/community/page_rec.js +++ b/routes/community/page_rec.js @@ -1,6 +1,7 @@ var express = require('express'); var router = express.Router(); var template = require('../../lib/template.js'); +var author = require('../../lib/author.js'); const db = require('../../db.js'); var path = require('path'); @@ -9,21 +10,48 @@ router.get('/community/recommendation/page/:pageId', function (request, response db.query(`SELECT * FROM recommendation WHERE id=?`, [pageId], function(err, res){ var title = '추천글보기'; var head = ` - .recommendation_page{ - margin-top:200px; - } - + `; var body = ` -
-
-

제목:${res[0].title}

-
-

내용:${res[0].content}

+
+
+

+
+
+
${res[0].title}
+
+
${res[0].content}
-
+
+
`; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }); }); diff --git a/routes/community/page_req.js b/routes/community/page_req.js index f44292e..b01d18e 100644 --- a/routes/community/page_req.js +++ b/routes/community/page_req.js @@ -1,30 +1,57 @@ var express = require('express'); var router = express.Router(); var template = require('../../lib/template.js'); +var author = require('../../lib/author.js'); const db = require('../../db.js'); var path = require('path'); router.get('/community/requirement/page/:pageId', function (request, response) { var pageId = path.parse(request.params.pageId).base; - db.query(`SELECT * FROM requirement WHERE id=?`, [pageId], function(err, res){ + db.query(`SELECT * FROM requirement WHERE id=?`, [pageId], function (err, res) { var title = '건의글보기'; var head = ` - + `; var body = ` -
-
-

제목:${res[0].title}

+
+
+

+
+
+
${res[0].title}

-

내용:${res[0].content}

+
${res[0].content}
-
+
+
`; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }); }); diff --git a/routes/login.js b/routes/login.js index a36667e..6e185f6 100644 --- a/routes/login.js +++ b/routes/login.js @@ -1,6 +1,7 @@ var express = require('express'); var router = express.Router(); var template = require('../lib/template.js'); +var author = require('../lib/author.js'); router.get('/login', function (request, response) { var title = '로그인'; @@ -158,13 +159,12 @@ router.get('/login', function (request, response) {
-
+

Email

- +
-

Password

- +
@@ -175,7 +175,7 @@ router.get('/login', function (request, response) {
`; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }); diff --git a/routes/login_process.js b/routes/login_process.js new file mode 100644 index 0000000..2dc707b --- /dev/null +++ b/routes/login_process.js @@ -0,0 +1,34 @@ +var express = require('express'); +var router = express.Router(); +var template = require('../lib/template.js'); +const db = require('../db.js'); +var qs = require('querystring'); + +router.post('/login_process', function (request, response) { + var body = ``; + request.on('data', function(data){ + body = body + data; + }); + request.on('end', function(){ + var post = qs.parse(body); + var email = post.email; + var password = post.password; + db.query(`SELECT password, nickname FROM user WHERE email=?`, [email], function(err, res){ + console.log(res[0]); + console.log(request.session); + if(res[0].password == password){ + request.session.is_logined = true; + request.session.email = email; + request.session.nickname = res[0].nickname; + request.session.save(function() { + response.redirect(`/`); + }); + } else { + response.send('Who?'); + } + response.redirect(`/`); + }); + }); +}); + +module.exports = router; \ No newline at end of file diff --git a/routes/logout_process.js b/routes/logout_process.js new file mode 100644 index 0000000..95dce80 --- /dev/null +++ b/routes/logout_process.js @@ -0,0 +1,21 @@ +var express = require('express'); +var router = express.Router(); +var template = require('../lib/template.js'); +const db = require('../db.js'); +var qs = require('querystring'); + +router.get('/logout_process', function(req,res){ + if(req.session.user){ + console.log('logout'); + + req.session.destroy(function(err){ + if(err) throw err; + res.redirect('/'); + }); + } + else{ + res.redirect('/'); + } +}); + +module.exports = router; \ No newline at end of file diff --git a/routes/main.js b/routes/main.js index 842dda4..df1762e 100644 --- a/routes/main.js +++ b/routes/main.js @@ -1,6 +1,7 @@ var express = require('express'); var router = express.Router(); var template = require('../lib/template.js'); +var author = require('../lib/author.js'); router.get('/', function (request, response) { var title = 'For me 나를 위해'; @@ -318,7 +319,7 @@ router.get('/', function (request, response) { `; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }); diff --git a/routes/mypage/main_mypage.js b/routes/mypage/main_mypage.js index 3a62063..85fde5b 100644 --- a/routes/mypage/main_mypage.js +++ b/routes/mypage/main_mypage.js @@ -1,6 +1,7 @@ var express = require('express'); var router = express.Router(); var template = require('../../lib/template.js'); +var author = require('../../lib/author.js'); const db = require('../../db.js'); router.get('/mypage', function (request, response) { @@ -11,7 +12,7 @@ router.get('/mypage', function (request, response) { var head = ` + `; + var body = ` +
+
+
+
+

나에게 딱맞는 월경용품 찾기

+
+ mainImage +
+

+ 시작하기 버튼을 눌러 시작해 주세요. +

+ +
+
+
+
+
+
+
+
+
+
+
+
+

나에게 딱맞는 월경용품 찾기 결과는?

+
+ +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
`; + + var html = template.HTML(title, head, body, author.statusUI(request, response)); + response.send(html); +}); + +module.exports = router; diff --git a/routes/prod_rec/question.js b/routes/prod_rec/question.js new file mode 100644 index 0000000..55b4dc6 --- /dev/null +++ b/routes/prod_rec/question.js @@ -0,0 +1,163 @@ +const QnAList = [{ + q: '월경이 규칙적인가요?', + a: [{ + answer: '예', + type: ['pad', 'cotton', 'cup', 'tampon'] + }, + { + answer: '아니오', + type: ['pad', 'tampon'] + }, + { + answer: '잘 모르겠어요', + type: ['pad', 'cotton', 'tampon'] + } + ] + }, + + { + q: '월경통이 어느 정도로 심각한가요?', + a: [{ + answer: '거의 없어요', + type: ['pad', 'cotton', 'cup', 'tampon'] + }, + { + answer: '보통이에요', + type: ['pad', 'cotton', 'cup', 'tampon'] + }, + { + answer: '심한 편이에요', + type: ['cotton', 'tampon'] + }, + { + answer: '아주 심해요', + type: ['cotton', 'cup'] + } + ] + }, + + { + q: '월경시 Y존 민감 증상(쓰라림, 가려움 등)이 있나요?', + a: [{ + answer: '거의 없어요', + type: ['pad', 'cotton', 'cup', 'tampon'] + }, + { + answer: '보통이에요', + type: ['pad', 'cotton', 'cup', 'tampon'] + }, + { + answer: '심한 편이에요', + type: ['cup', 'cotton', 'tampon'] + }, + { + answer: '아주 심해요', + type: ['cup', 'tampon'] + } + ] + }, + + { + q: '월경시 활동량은 많은 편인가요?', + a: [{ + answer: '거의 움직이지 않는 편이에요', + type: ['pad', 'cotton', 'cup', 'tampon'] + }, + { + answer: '보통이에요', + type: ['pad', 'cotton', 'cup', 'tampon'] + }, + { + answer: '매우 활발한 편이에요', + type: ['cup', 'tampon'] + } + ] + }, + + { + q: '구매에 대한 생각이 궁금해요!', + a: [{ + answer: '언제 어디서든 쉽게 구할 수 있었으면 좋겠어요', + type: ['pad'] + }, + { + answer: '인터넷에서 사서 상관없어요', + type: ['pad', 'cotton', 'cup', 'tampon'] + }, + { + answer: '매달 구매하는 과정이 귀찮아요', + type: ['cotton', 'cup'] + } + ] + }, + + { + q: '유기농 제품에 대한 생각이 궁금해요', + a: [{ + answer: '잘 모르고 관심없어요', + type: ['pad', 'tampon'] + }, + { + answer: '관심은 있는 데 찾아서 사용하진 않아요', + type: ['pad', 'cotton', 'cup', 'tampon'] + }, + { + answer: '찾아서 사용하고 있어요', + type: ['pad', 'cotton', 'cup'] + } + ] + }, + + { + q: '월경용품을 사용하면서 가장 불편한 점은 무엇인가요?', + a: [{ + answer: '쓰레기가 너무 많이 나와요', + type: ['cotton', 'cup'] + }, + { + answer: '장시간 외출 시 사용이 불편해요', + type: ['pad', 'tampon'] + }, + { + answer: '판매하는 제품이 다양하지 않아요', + type: ['pad'] + } + ] + }, + + { + q: '삽입형 월경용품에 대한 거부감이 있나요?', + a: [{ + answer: '네 거부감이 있어요', + type: ['pad', 'cotton'] + }, + { + answer: '아뇨 없어요', + type: ['cup', 'tampon'] + }, + { + answer: '잘 모르겠어요', + type: ['pad', 'cup', 'cotton', 'tampon'] + } + ] + } +] + + +const infoList = [{ + name: '클래식 이즈 더 베스트 <일회용 월경대>', + desc: '가장 많은 사람들이 사용하고 있는 제품군이예요. 판매하는 제품군이 다양하고 언제 어디서나 쉽게 구할 수 있다는 게 큰 장점이에요.' + }, + { + name: ' <면 월경대>', + desc: '' + }, + { + name: '<월경컵>', + desc: '월경계의 신문물 월경컵! 활동이 많은 날도 사용할 수 있어요. 재사용이 가능하고 세척도 쉬운 편 ' + }, + { + name: ' <탐폰>', + desc: '활동이 많은 날에도 샘걱정 없이 사용할 수 있어요! 8시간 이상 사용은 권하지 않아요.' + } +] \ No newline at end of file diff --git a/routes/prod_rec/start.js b/routes/prod_rec/start.js new file mode 100644 index 0000000..523be80 --- /dev/null +++ b/routes/prod_rec/start.js @@ -0,0 +1,132 @@ +const main = document.querySelector("#main"); +const qna = document.querySelector("#qna"); +const result = document.querySelector("#result"); +const endPoint = 7; +const select = [0, 0, 0, 0]; + +function calResult(){ + // var pointArray = [ + // { name: 'pad', value: 0, key: 0 }, + // { name: 'cotton', value: 0, key: 0}, + // { name: 'cup', value: 0, key: 0}, + // { name: 'tampon', value: 0, key: 0} + // ] + // for(let i = 0; i < endPoint; i++){ + // var target = QnAList[i].a[select[i]]; + // for(let j = 0; j < target.type.length; j++){ + // for(let k = 0; k< pointArray.length; k++){ + // if(target.type[j] === pointArray[k].name){ + // pointArray[k].value += 1; + // } + // } + // } + // } + + // var resultArray = pointArray.sort(function (a, b){ + // if(a.value > b.value){ + // return -1; + // } + // if(a.value < b.value){ + // return 1; + // } + // return 0; + // }); + + // let resultword = resultArray[0].key; + // return resultword; + + console.log(select); + var result = select.indexOf(Math.max(...select)); + return result; +} + +function setResult(){ + let point = calResult(); + const resultName = document.querySelector('.resultname'); + resultName.innerHTML = infoList[point].name; + + var resultImg = document.createElement('img'); + const imgDiv = document.querySelector('#resultImg'); + var imgURL = '../../public/images/image-' + point + '.png'; + resultImg.src = imgURL; + resultImg.alt = point; + resultImg.classList.add('img-fluid'); + imgDiv.appendChild(resultImg); + + const resultDesc = document.querySelector('.resultDesc'); + resultDesc.innerHTML = infoList[point].desc; +} +function goResult(){ + qna.style.WebitAnimation = "fadeOut 1s"; + qna.style.animation = "fadeOut 1s"; + setTimeout(() => { + result.style.WebitAnimation = "fadeIn 1s"; + result.style.animation = "fadeIn 1s"; + setTimeout(() => { + qna.style.display = "none"; + result.style.display = "block"; + }, 450)}) + setResult(); +} + +function addAnswer(answerText, qIdx, idx) { + var a = document.querySelector('.answerBox'); + var answer = document.createElement('button'); + answer.classList.add('answerList'); + answer.classList.add('my-3'); + answer.classList.add('py-3'); + answer.classList.add('mx-auto'); + answer.classList.add('fadeIn'); + + a.appendChild(answer); + answer.innerHTML = answerText; + + answer.addEventListener("click", function () { + var children = document.querySelectorAll('.answerList'); + for (let i = 0; i < children.length; i++) { + children[i].disabled = true; + children[i].style.WebitAnimation = "fadeOut 0.3s"; + children[i].style.animation = "fadeOut 0.3s"; + } + setTimeout(() =>{ + var target = QnAList[qIdx].a[idx].type; + for(let i = 0; i < target.length; i++){ + select[target[i]] += 1; + } + for(let i = 0; i < children.length; i++){ + children[i].style.display = 'none'; + } + goNext(++qIdx); + },450) + }, false); +} + +function goNext(qIdx) { + if (qIdx === endPoint) { + goResult() + return; + } + var q = document.querySelector('.qBox'); + q.innerHTML = QnAList[qIdx].q; + for (let i in QnAList[qIdx].a) { + addAnswer(QnAList[qIdx].a[i].answer, qIdx, i); + } + var status = document.querySelector('.statusBar'); + status.style.width = (100 / endPoint) * (qIdx + 1) + '%'; +} + +function begin() { + main.style.WebitAnimation = "fadeOut 1s"; + main.style.animation = "fadeOut 1s"; + setTimeout(() => { + + qna.style.WebitAnimation = "fadeIn 1s"; + qna.style.animation = "fadeIn 1s"; + setTimeout(() => { + main.style.display = "none"; + qna.style.display = "block"; + }, 450) + let qIdx = 0; + goNext(qIdx); + }, 450); +} \ No newline at end of file diff --git a/routes/recommend.js b/routes/recommend.js index 954b2b7..4f5386c 100644 --- a/routes/recommend.js +++ b/routes/recommend.js @@ -1,6 +1,7 @@ var express = require('express'); var router = express.Router(); var template = require('../lib/template.js'); +var author = require('../lib/author.js'); router.get('/recommend', function (request, response) { var title = `월경 용품 추천`; @@ -126,7 +127,7 @@ router.get('/recommend', function (request, response) { `; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }); diff --git a/routes/search.js b/routes/search.js index afb61b3..52ec6e6 100644 --- a/routes/search.js +++ b/routes/search.js @@ -3,6 +3,7 @@ var router = express.Router(); var template = require('../lib/template.js'); const db = require('../db.js'); var qs = require('querystring'); +var author = require('../lib/author.js'); router.post('/search', function (request, response) { var _body = ``; @@ -11,69 +12,257 @@ router.post('/search', function (request, response) { }); request.on('end', function(){ var post = qs.parse(_body); - db.query(`SELECT * FROM recommendation WHERE content LIKE ? OR title LIKE ?`, ['%' + post.search + '%', '%' + post.search + '%'], function(err, res){ - //제품 검색 추가 필요! - var title = '검색결과'; - var head = ` - - `; - var list_store = ` -

제품

-

'${post.search}'에 대한 검색 결과가 없습니다.

- `; - var list_rec = ''; - var i = 0; - if(res.length === 0){ - list_rec += ` -

제품추천

-

'${post.search}'에 대한 검색 결과가 없습니다.

- `; - } else{ - list_rec += ` - 제품추천 - - No. - Title. - Writer - Date - - `; - while(i < res.length) { - list_rec += ` - - ${res[i].id} - - ${res[i].title} - - ${res[i].writer} - ${res[i].date} - - `; - i++; - } - } - var body = ` -
-
- -

-
- - ${list_store} -
-

- - ${list_rec} -
-
- -
-
- `; - var html = template.HTML(title, head, body); - response.send(html); + db.query(`SELECT * FROM recommendation WHERE content LIKE ? OR title LIKE ?`, ['%' + post.search + '%', '%' + post.search + '%'], function(err, rec){ + db.query(`SELECT * FROM pad WHERE company LIKE ? OR brand LIKE ? OR product LIKE ?`, ['%' + post.search + '%', '%' + post.search + '%', '%' + post.search + '%'], function(err, pad){ + db.query(`SELECT * FROM cpad WHERE company LIKE ? OR product LIKE ?`, ['%' + post.search + '%', '%' + post.search + '%'], function(err, cpad){ + db.query(`SELECT * FROM cup WHERE company LIKE ? OR product LIKE ?`, ['%' + post.search + '%', '%' + post.search + '%'], function(err, cup){ + db.query(`SELECT * FROM tampon WHERE company LIKE ? OR brand LIKE ? OR product LIKE ?`, ['%' + post.search + '%', '%' + post.search + '%', '%' + post.search + '%'], function(err, tampon){ + var title = '검색결과'; + var head = ` + + `; + var list_pad = ''; + if(pad.length === 0){ + list_pad += ` +
+

'${post.search}'에 대한 검색 결과가 없습니다.

+
+ `; + } else{ + for(i = 0; i < pad.length; i++) { + list_pad += ` +
+
+ +
+ +
+
제조사명
: ${pad[i].company}

+
제품명
: ${pad[i].product}
+
+
+
+
+
+ `; + } + } + var list_cpad = ''; + if(cpad.length === 0){ + list_cpad += ` +
+

'${post.search}'에 대한 검색 결과가 없습니다.

+
+ `; + } else{ + for(i = 0; i < cpad.length; i++) { + list_cpad += ` +
+
+ +
+ +
+
제조사명
: ${cpad[i].company}

+
제품명
: ${cpad[i].product}
+
+
+
+
+
+
+ `; + } + } + + var list_cup = ''; + if(cup.length === 0){ + list_cup += ` +
+

'${post.search}'에 대한 검색 결과가 없습니다.

+
+ `; + } else{ + for(i = 0; i < cup.length; i++) { + list_cup += ` +
+
+ +
+ +
+
제조사명
: ${cup[i].company}

+
제품명
: ${cup[i].product}
+
+
+
+
+
+
+ `; + } + } + + var list_tampon = ''; + if(tampon.length === 0){ + list_tampon += ` +
+

'${post.search}'에 대한 검색 결과가 없습니다.

+
+ `; + } else{ + for(i = 0; i < tampon.length; i++) { + list_tampon += ` +
+
+ +
+ +
+
제조사명
: ${tampon[i].company}

+
제품명
: ${tampon[i].product}
+
+
+
+
+
+
+ `; + } + } + var list_rec = ''; + if(rec.length === 0){ + list_rec += ` +

제품추천

+

'${post.search}'에 대한 검색 결과가 없습니다.

+ `; + } else{ + list_rec += ` + + No + 제목. + 작성자 + 작성일 + + + `; + for(i = 0; i < rec.length; i++) { + list_rec += ` + + ${rec[i].id} + + ${rec[i].title} + + ${rec[i].writer} + ${rec[i].date} + + `; + } + } + var body = ` +
+
+

+
+

일회용 월경대

+ ${list_pad} +
+ +


+
+

면 월경대

+ ${list_cpad} +
+


+
+

월경컵

+ ${list_cup} +
+


+
+

탐폰

+ ${list_tampon} +
+ +


+
+
+
+
+ + + ${list_rec} +
+
+
+
+
+
+ `; + var html = template.HTML(title, head, body, author.statusUI(request, response)); + response.send(html); + }) + }) + }) + }) }) }) }); diff --git a/routes/signup.js b/routes/signup.js index e39b796..7ef535f 100644 --- a/routes/signup.js +++ b/routes/signup.js @@ -1,6 +1,7 @@ var express = require('express'); var router = express.Router(); var template = require('../lib/template.js'); +var author = require('../lib/author.js'); const db = require('../db.js'); router.get('/signup', function (request, response) { @@ -162,7 +163,7 @@ router.get('/signup', function (request, response) { `; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }); diff --git a/routes/signup_process.js b/routes/signup_process.js index 4ab7629..53f5448 100644 --- a/routes/signup_process.js +++ b/routes/signup_process.js @@ -13,15 +13,18 @@ router.post('/signup_process', function (request, response) { var post = qs.parse(body); var email = post.email; var password = post.password; + var password_check = post.password_check; var nickname = post.nickname; - db.query(`INSERT INTO user (email, password, nickname) VALUES(?, ?, ?)`, [email, password, nickname], function(err, res){ - if(err) { - response.writeHead(302, {Location: `/signup`}); + if(password == password_check){ + db.query(`INSERT INTO user (email, password, nickname) VALUES(?, ?, ?)`, [email, password, nickname], function(err, res){ + if(err) { + response.writeHead(200, {Location: `/signup`}); + response.end(); + } + response.writeHead(302, {Location: `/`}); response.end(); - } - response.writeHead(302, {Location: `/`}); - response.end(); - }); + }); + } }); }); diff --git a/routes/store/cpad.js b/routes/store/cpad.js index 71a5a84..6c46010 100644 --- a/routes/store/cpad.js +++ b/routes/store/cpad.js @@ -2,6 +2,7 @@ var express = require('express'); const db = require('../../db.js'); var router = express.Router(); var template = require('../../lib/template.js'); +var author = require('../../lib/author.js'); router.get('/store/cpad', function (request, response) { db.query(`SELECT * FROM cpad`, function(err, res){ @@ -108,7 +109,7 @@ router.get('/store/cpad', function (request, response) { `; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }) }); diff --git a/routes/store/cup.js b/routes/store/cup.js index 56146fb..1bb2ef5 100644 --- a/routes/store/cup.js +++ b/routes/store/cup.js @@ -2,6 +2,7 @@ var express = require('express'); const db = require('../../db.js'); var router = express.Router(); var template = require('../../lib/template.js'); +var author = require('../../lib/author.js'); router.get('/store/cup', function (request, response) { db.query(`SELECT * FROM cup`, function(err, res){ @@ -107,7 +108,7 @@ router.get('/store/cup', function (request, response) { `; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }) }); diff --git a/routes/store/merit.js b/routes/store/merit.js index 22768bf..0decac9 100644 --- a/routes/store/merit.js +++ b/routes/store/merit.js @@ -1,6 +1,7 @@ var express = require('express'); var router = express.Router(); var template = require('../../lib/template.js'); +var author = require('../../lib/author.js'); router.get('/store/merit', function (request, response) { var title = '제품별장단점'; @@ -33,7 +34,7 @@ router.get('/store/merit', function (request, response) {

`; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }); diff --git a/routes/store/pad.js b/routes/store/pad.js index 4b00903..0968463 100644 --- a/routes/store/pad.js +++ b/routes/store/pad.js @@ -2,6 +2,7 @@ var express = require('express'); const db = require('../../db.js'); var router = express.Router(); var template = require('../../lib/template.js'); +var author = require('../../lib/author.js'); router.get('/store/pad', function (request, response) { db.query(`SELECT * FROM pad`, function(err, res){ @@ -77,7 +78,7 @@ router.get('/store/pad', function (request, response) { `; - } + } var body = ` @@ -108,7 +109,7 @@ router.get('/store/pad', function (request, response) { `; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }) }); diff --git a/routes/store/tampon.js b/routes/store/tampon.js index 0dcb62d..27284d7 100644 --- a/routes/store/tampon.js +++ b/routes/store/tampon.js @@ -2,6 +2,7 @@ var express = require('express'); const db = require('../../db.js'); var router = express.Router(); var template = require('../../lib/template.js'); +var author = require('../../lib/author.js'); router.get('/store/tampon', function (request, response) { db.query(`SELECT * FROM tampon`, function(err, res){ @@ -108,7 +109,7 @@ router.get('/store/tampon', function (request, response) { `; - var html = template.HTML(title, head, body); + var html = template.HTML(title, head, body, author.statusUI(request, response)); response.send(html); }) }); diff --git a/signup.html b/signup.html deleted file mode 100644 index c9f137c..0000000 --- a/signup.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - - - 회원가입 - - - - - - - -
- -
- -
-


- -
-
- -
-

Email

- -
-

Password

- -
- -

Nickname

- -
- For me 정책에 동의합니다.
- -

───────────── OR ─────────────

-

Already have a account? Log in

-
-
-
-
- - - \ No newline at end of file diff --git a/src/accounts/find_pw.html b/src/accounts/find_pw.html deleted file mode 100644 index 81def97..0000000 --- a/src/accounts/find_pw.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - Document - - - - -
-
-
-
-

비밀번호 찾기

-

입력하신 이메일로 비밀번호 재설정 링크를 보내드립니다.

-
- -
-
- -
-
-
-
-
- \ No newline at end of file diff --git a/src/accounts/myPage.html b/src/accounts/myPage.html deleted file mode 100644 index 0286dec..0000000 --- a/src/accounts/myPage.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - Document - - - - -
-
-

${name}님 안녕하세요!

-
- 찜❤ 187 - 글📝 5 - 댓글 5 -
-
-

나의 정보

-
-
-
-
-

나의 찜

-
-
-
-
-
-

나의 글

-
-
-
-
-
-

나의 댓글

-
-
-
-
-

공지사항

-
-
-
-
-
- \ No newline at end of file