김태희

회원가입 기능 구현방법 변경-파일삭제

1 -exports.register = function (req, res) {
2 - // console.log("req", req.body);
3 - var today = new Date();
4 - var users = {
5 - "UserNo": req.body.UserNo,
6 - "UserID": req.body.UserID,
7 - "UserPw": req.body.UserPw,
8 - "password": req.body.password,
9 - "created": today,
10 - "modified": today
11 - }
12 - connenction.query('INSERT INTO users SET ?' , users, function (error, results, fields) {
13 - if (error) {
14 - console.log("error ocurred", error);
15 - res.send({
16 - "code" : 400,
17 - "failed": "error ocurred"
18 - })
19 - } else {
20 - console.log('The solution is: ', results);
21 - res.send({
22 - "code": 200,
23 - "success": "user registered sucessfully"
24 - });
25 - }
26 - });
27 -}