정지윤

데이터베이스 오류 수정

...@@ -30,9 +30,8 @@ router.post('/reservation',function(req, res){ ...@@ -30,9 +30,8 @@ router.post('/reservation',function(req, res){
30 var restime = req.body.restime; 30 var restime = req.body.restime;
31 var resmin = req.body.resmin; 31 var resmin = req.body.resmin;
32 var date = req.body.date; 32 var date = req.body.date;
33 - 33 + var food = req.body.food;
34 var content = req.body.content; 34 var content = req.body.content;
35 - var food = req.body.food;
36 pool.getConnection(function (err, connection) 35 pool.getConnection(function (err, connection)
37 { 36 {
38 // Use the connection 37 // Use the connection
...@@ -40,6 +39,7 @@ router.post('/reservation',function(req, res){ ...@@ -40,6 +39,7 @@ router.post('/reservation',function(req, res){
40 connection.query(sqlForInsertBoard, function (err, rows) { 39 connection.query(sqlForInsertBoard, function (err, rows) {
41 if (err) console.error("err : " + err); 40 if (err) console.error("err : " + err);
42 console.log("rows : " + JSON.stringify(rows)); 41 console.log("rows : " + JSON.stringify(rows));
42 + res.redirect('/resconfirm');
43 connection.release(); 43 connection.release();
44 // Don't use the connection here, it has been returned to the pool. 44 // Don't use the connection here, it has been returned to the pool.
45 }); 45 });
...@@ -75,6 +75,7 @@ router.get('/db', function(req, res){ ...@@ -75,6 +75,7 @@ router.get('/db', function(req, res){
75 /* GET home page. */ 75 /* GET home page. */
76 router.get('/pay', function(req, res, next) { 76 router.get('/pay', function(req, res, next) {
77 res.render('pay', { title: '결제' }); 77 res.render('pay', { title: '결제' });
78 + res.render('first');
78 }); 79 });
79 80
80 module.exports = router; 81 module.exports = router;
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
63 <div class="col-lg-8 mx-auto"> 63 <div class="col-lg-8 mx-auto">
64 <h1 class="brand-heading" style="background-color: rgba( 0, 0, 0, 0.7 );">별빛바다 달빛초원</h1> 64 <h1 class="brand-heading" style="background-color: rgba( 0, 0, 0, 0.7 );">별빛바다 달빛초원</h1>
65 <p class="intro-text"> 65 <p class="intro-text">
66 - <br>정지윤</p> 66 + <br>아래로 내리세요</p>
67 <a href="#about" class="btn btn-circle js-scroll-trigger"> 67 <a href="#about" class="btn btn-circle js-scroll-trigger">
68 <i class="fa fa-angle-double-down animated"></i> 68 <i class="fa fa-angle-double-down animated"></i>
69 </a> 69 </a>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
44 buyer_tel : '010-8762-3073', 44 buyer_tel : '010-8762-3073',
45 buyer_addr : '서울특별시 강남구 삼성동', 45 buyer_addr : '서울특별시 강남구 삼성동',
46 buyer_postcode : '123-456', 46 buyer_postcode : '123-456',
47 - m_redirect_url : 'https://localhost:3000/resconfirm' 47 + m_redirect_url : 'http://localhost:3000/reservation'
48 }, function(rsp) { 48 }, function(rsp) {
49 if ( rsp.success ) { 49 if ( rsp.success ) {
50 var msg = '결제가 완료되었습니다.'; 50 var msg = '결제가 완료되었습니다.';
...@@ -52,11 +52,17 @@ ...@@ -52,11 +52,17 @@
52 msg += '상점 거래ID : ' + rsp.merchant_uid; 52 msg += '상점 거래ID : ' + rsp.merchant_uid;
53 msg += '결제 금액 : ' + rsp.paid_amount; 53 msg += '결제 금액 : ' + rsp.paid_amount;
54 msg += '카드 승인번호 : ' + rsp.apply_num; 54 msg += '카드 승인번호 : ' + rsp.apply_num;
55 - } else { 55 +
56 + alert(msg);
57 + document.location.href="/reservation";
58 + }
59 +
60 + else {
56 var msg = '결제에 실패하였습니다.'; 61 var msg = '결제에 실패하였습니다.';
57 msg += '에러내용 : ' + rsp.error_msg; 62 msg += '에러내용 : ' + rsp.error_msg;
63 + alert(msg);
64 + document.location.href="/first";
58 } 65 }
59 - alert(msg);
60 }); 66 });
61 </script> 67 </script>
62 </html> 68 </html>
......
This diff is collapsed. Click to expand it.