Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
eue
Commits
cd675153
Commit
cd675153
authored
Aug 04, 2021
by
KangMin An
Browse files
Update: 비로그인 시 기본 사용자 지역코드 반환 코드 추가.
parent
8866a1c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/src/controllers/userController.js
View file @
cd675153
...
@@ -209,12 +209,12 @@ export const getConfirm = async (req, res) => {
...
@@ -209,12 +209,12 @@ export const getConfirm = async (req, res) => {
// 사용자 정보 요청 처리
// 사용자 정보 요청 처리
export
const
getUserInfo
=
async
(
req
,
res
)
=>
{
export
const
getUserInfo
=
async
(
req
,
res
)
=>
{
const
{
cookies
:
{
acs_token
},
}
=
req
;
try
{
try
{
const
decoded
=
jwt
.
decode
(
acs_token
);
const
{
cookies
:
{
acs_token
},
}
=
req
;
const
decoded
=
jwt
.
verify
(
acs_token
);
const
result_user
=
await
db
.
User
.
findAll
({
const
result_user
=
await
db
.
User
.
findAll
({
where
:
{
email
:
decoded
.
email
},
where
:
{
email
:
decoded
.
email
},
...
@@ -261,7 +261,17 @@ export const getUserInfo = async (req, res) => {
...
@@ -261,7 +261,17 @@ export const getUserInfo = async (req, res) => {
res
.
json
({
msg
:
resForm
.
msg
.
ok
,
contents
:
{
user_info
:
[
user
]
}
});
res
.
json
({
msg
:
resForm
.
msg
.
ok
,
contents
:
{
user_info
:
[
user
]
}
});
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
err
);
console
.
log
(
err
);
res
.
json
({
msg
:
resForm
.
msg
.
err
,
contents
:
{
error
:
err
}
});
// Return error message and default user.(독도)
res
.
json
({
msg
:
resForm
.
msg
.
err
,
contents
:
{
user_info
:
{
loc_code
:
3743011
,
},
error
:
err
,
},
});
}
}
};
};
...
...
server/src/routers/globalRouter.js
View file @
cd675153
...
@@ -30,7 +30,7 @@ globalRouter.get(routes.logout, onlyPrivate, getLogout);
...
@@ -30,7 +30,7 @@ globalRouter.get(routes.logout, onlyPrivate, getLogout);
globalRouter
.
get
(
routes
.
confirm
,
getConfirm
);
globalRouter
.
get
(
routes
.
confirm
,
getConfirm
);
// User Info
// User Info
globalRouter
.
get
(
routes
.
userinfo
,
onlyPrivate
,
getUserInfo
);
globalRouter
.
get
(
routes
.
userinfo
,
getUserInfo
);
globalRouter
.
post
(
routes
.
editProfile
,
onlyPrivate
,
postEditProfile
);
globalRouter
.
post
(
routes
.
editProfile
,
onlyPrivate
,
postEditProfile
);
globalRouter
.
get
(
routes
.
toggleAircon
,
onlyPrivate
,
getToggleAircon
);
globalRouter
.
get
(
routes
.
toggleAircon
,
onlyPrivate
,
getToggleAircon
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment