add admin

This commit is contained in:
2025-07-08 19:18:06 +08:00
parent 789ba73f81
commit 90a1116374

View File

@@ -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,