add admin
This commit is contained in:
@@ -7,12 +7,12 @@ async function main() {
|
|||||||
console.log('开始初始化数据库...');
|
console.log('开始初始化数据库...');
|
||||||
|
|
||||||
// 创建管理员用户
|
// 创建管理员用户
|
||||||
const adminPassword = await bcrypt.hash('admin123', 12);
|
const adminPassword = await bcrypt.hash('6zyFhbwqhUpq7m0ex1', 12);
|
||||||
const admin = await prisma.user.upsert({
|
const admin = await prisma.user.upsert({
|
||||||
where: { username: 'admin' },
|
where: { username: 'bluish' },
|
||||||
update: {},
|
update: {},
|
||||||
create: {
|
create: {
|
||||||
username: 'admin',
|
username: 'bluish',
|
||||||
password: adminPassword,
|
password: adminPassword,
|
||||||
isAdmin: true,
|
isAdmin: true,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user