Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing
/
D_Team_Khuloud
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
toror33
2020-05-25 14:49:25 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0680ea14a84c2b21c1f7a67ea9d479a393513987
0680ea14
1 parent
079541a3
회원정보 수정
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
backend/routes/userlogin/user.js
backend/routes/userlogin/user.js
View file @
0680ea1
...
...
@@ -42,4 +42,39 @@ router.get('/', function(req, res, next) {
});
router
.
post
(
'/update'
,
function
(
req
,
res
,
next
)
{
var
user_id
=
req
.
body
.
user_id
;
var
user_pw
=
req
.
body
.
user_pw
;
var
user_pw2
=
req
.
body
.
user_pw2
;
var
user_email
=
req
.
body
.
user_email
;
// var user_phone=req.body.user_phone;
if
(
user_pw
===
user_pw2
)
{
console
.
log
(
user_pw2
);
// user_pw=CryptoJS.AES.encrypt(user_pw, 'secret key 123');
user_pw
=
cryptoM
.
encrypt
(
user_pw
);
var
sql
=
'UPDATE users SET user_pw = ?, user_email= ? WHERE user_id = ?'
;
var
values
=
[
user_pw
,
user_email
,
user_id
];
connection
.
query
(
sql
,
values
,
function
(
err
)
{
if
(
err
)
{
console
.
log
(
"updating user failed"
);
//res.send({result:false});
//throw err;
}
else
{
console
.
log
(
"user updated successfully"
);
res
.
redirect
(
'back'
);
}
});
}
else
{
console
.
log
(
"비밀번호가 일치하지 않습니다."
);
res
.
send
({
result
:
false
});
res
.
redirect
(
'back'
);
}
});
module
.
exports
=
router
;
...
...
Please
register
or
login
to post a comment