security: 修改 seeder 中的默认密码为安全密码

- 将所有测试账户的密码从 'password' 改为 'TRG}E^5BvPcbyErc'
- 更新 Hash::make() 调用中的密码参数
- 更新账号信息输出中的密码显示
This commit is contained in:
2026-03-12 17:59:23 +08:00
parent 06cf30130d
commit bbe8e60646

View File

@@ -31,7 +31,7 @@ class DatabaseSeeder extends Seeder
$admin = User::factory()->create([
'name' => '系统管理员',
'email' => 'admin@example.com',
'password' => Hash::make('password'),
'password' => Hash::make('TRG}E^5BvPcbyErc'),
]);
// 为管理员分配 super-admin 角色
@@ -42,28 +42,28 @@ class DatabaseSeeder extends Seeder
$user1 = User::factory()->create([
'name' => '张三',
'email' => 'zhangsan@example.com',
'password' => Hash::make('password'),
'password' => Hash::make('TRG}E^5BvPcbyErc'),
]);
$user1->assignRole('user');
$user2 = User::factory()->create([
'name' => '李四',
'email' => 'lisi@example.com',
'password' => Hash::make('password'),
'password' => Hash::make('TRG}E^5BvPcbyErc'),
]);
$user2->assignRole('user');
$user3 = User::factory()->create([
'name' => '王五',
'email' => 'wangwu@example.com',
'password' => Hash::make('password'),
'password' => Hash::make('TRG}E^5BvPcbyErc'),
]);
$user3->assignRole('admin');
$user4 = User::factory()->create([
'name' => '赵六',
'email' => 'zhaoliu@example.com',
'password' => Hash::make('password'),
'password' => Hash::make('TRG}E^5BvPcbyErc'),
]);
$user4->assignRole('user');
@@ -234,10 +234,10 @@ class DatabaseSeeder extends Seeder
$this->command->info(' - 专用文档: ' . Document::dedicated()->count());
$this->command->newLine();
$this->command->info('=== 测试账号信息 ===');
$this->command->info('超级管理员: admin@example.com / password (super-admin)');
$this->command->info('张三BL02U1: zhangsan@example.com / password (user)');
$this->command->info('李四BL02U1: lisi@example.com / password (user)');
$this->command->info('王五BL07U: wangwu@example.com / password (admin)');
$this->command->info('赵六BL08U: zhaoliu@example.com / password (user)');
$this->command->info('超级管理员: admin@example.com / TRG}E^5BvPcbyErc (super-admin)');
$this->command->info('张三BL02U1: zhangsan@example.com / TRG}E^5BvPcbyErc (user)');
$this->command->info('李四BL02U1: lisi@example.com / TRG}E^5BvPcbyErc (user)');
$this->command->info('王五BL07U: wangwu@example.com / TRG}E^5BvPcbyErc (admin)');
$this->command->info('赵六BL08U: zhaoliu@example.com / TRG}E^5BvPcbyErc (user)');
}
}