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
butter-studio
Commits
aeb47124
Commit
aeb47124
authored
Aug 10, 2021
by
Kim, Subin
Browse files
admin User 반복생성 수정 완료
parent
dd785351
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/index.js
View file @
aeb47124
...
...
@@ -18,20 +18,21 @@ sequelize
})
);
const
adminRole
=
await
Role
.
findOne
({
where
:
{
name
:
"
admin
"
}
});
if
(
!
adminRole
)
{
await
User
.
create
({
const
adminRole
=
await
Role
.
findOne
({
where
:
{
name
:
"
admin
"
}
})
await
User
.
findOrCreate
({
where
:
{
userId
:
"
admin
"
},
defaults
:
{
userId
:
"
admin
"
,
name
:
"
관리자
"
,
email
:
"
han35799@naver.com
"
,
nickname
:
"
haha
"
,
birth
:
"
990926
"
,
phoneNumber
:
"
010
8607458
0
"
,
nickname
:
"
admin
"
,
birth
:
"
000000
"
,
phoneNumber
:
"
010
0000000
0
"
,
password
:
"
admin!
"
,
img
:
"
970aaa79673a39331d45d4b55ca05d25
"
,
roleId
:
adminRole
?.
id
,
}
);
}
else
{
}
}
}
);
app
.
listen
(
appConfig
.
port
,
()
=>
{
console
.
log
(
`Server is running on port
${
appConfig
.
port
}
`
);
...
...
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