新增角色初始化数据
This commit is contained in:
parent
4dc2978d61
commit
fca8980715
@ -8,3 +8,29 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: JaguarJack [ njphper@gmail.com ]
|
// | Author: JaguarJack [ njphper@gmail.com ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
use think\migration\Seeder;
|
||||||
|
|
||||||
|
class RolesSeed extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run Method.
|
||||||
|
*
|
||||||
|
* Write your database seeder using this method.
|
||||||
|
*
|
||||||
|
* More information on writing seeders is available here:
|
||||||
|
* http://docs.phinx.org/en/latest/seeding.html
|
||||||
|
*/
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
\catchAdmin\permissions\model\Roles::create([
|
||||||
|
'role_name' => '超级管理员',
|
||||||
|
'description' => 'super user',
|
||||||
|
'creator_id' => 1,
|
||||||
|
]);
|
||||||
|
|
||||||
|
\think\facade\Db::name( 'user_has_roles')->insert([
|
||||||
|
'role_id' => 1,
|
||||||
|
'uid' => 1,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user