|
|
@@ -948,7 +948,6 @@ async function seedUsers() {
|
|
|
|
|
|
// Upsert role by unique name
|
|
|
const roleCreateData: Prisma.SysRoleUncheckedCreateInput = {
|
|
|
- id: 1,
|
|
|
name: '管理员',
|
|
|
remark: '管理员专用',
|
|
|
};
|
|
|
@@ -961,7 +960,6 @@ async function seedUsers() {
|
|
|
|
|
|
// Upsert admin user by unique username
|
|
|
const adminUserCreateData: Prisma.SysUserUncheckedCreateInput = {
|
|
|
- id: 1,
|
|
|
username: 'admin',
|
|
|
password: '$2b$12$iS0UJ1YqSal0N3uwin/OvOABUINAclcZGjHNyGFC7mlwRYTFjGQ26',
|
|
|
remark: '默认拥有所有菜单权限,不需要配置角色',
|
|
|
@@ -980,7 +978,6 @@ async function seedUsers() {
|
|
|
});
|
|
|
if (!existingLink) {
|
|
|
const userRoleCreateData: Prisma.SysUserRoleUncheckedCreateInput = {
|
|
|
- id: 1,
|
|
|
userId: adminUser.id,
|
|
|
roleId: role.id,
|
|
|
};
|
|
|
@@ -1000,7 +997,7 @@ async function seedUsers() {
|
|
|
async function seedMenus() {
|
|
|
console.log('📝 Seeding menus...');
|
|
|
|
|
|
- const legacyIdToNewId = new Map<number, number>();
|
|
|
+ const legacyIdToNewId = new Map<number, string>();
|
|
|
const inserted = new Set<number>();
|
|
|
|
|
|
// Multi-pass insertion: insert records whose parent is either null or already inserted
|
|
|
@@ -1027,7 +1024,6 @@ async function seedMenus() {
|
|
|
|
|
|
const permissions = getDefaultPermissions(seed.type);
|
|
|
const menuCreateData: Prisma.SysMenuUncheckedCreateInput = {
|
|
|
- id: seed.legacyId,
|
|
|
parentId,
|
|
|
title: seed.title,
|
|
|
status: true,
|