initData.sql 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. -- -- 添加一个账号
  2. -- INSERT INTO sys_users (id, username, password, name, state, user_type, created_at, updated_at)
  3. -- SELECT 1, 'admin', 'bWlyZW5kZW1pYW5iYW9uYenypblyMogTK3fAPeP3HTk=', '迷人的面包呐', 1, 1, '2024-09-13 15:33:03', '2024-09-13 07:43:14'
  4. -- WHERE NOT EXISTS (SELECT id FROM sys_users LIMIT 1);
  5. -- -- 添加基础路由
  6. -- INSERT INTO sys_menus (`id`, `menu_id`, `name`, `url`, `perms`, `type`, `path`, `refresh`, `icon`, `sort_number`, `created_at`, `updated_at`)
  7. -- SELECT 1, NULL, '系统', NULL, 'system', '1', 'system', "0", 'menu-gongju', 1, '2024-09-13 08:18:42', '2024-09-13 08:36:18'
  8. -- WHERE NOT EXISTS (SELECT 1 FROM sys_menus WHERE id = 1);
  9. -- INSERT INTO sys_menus (`id`, `menu_id`, `name`, `url`, `perms`, `type`, `path`, `refresh`, `icon`, `sort_number`, `created_at`, `updated_at`)
  10. -- SELECT 2, 1, '菜单管理', 'views/system/menu/index.vue', 'system-menu', '2', 'system-menu', '', "0", 1, '2024-09-13 08:20:44', '2024-09-13 08:33:53'
  11. -- WHERE NOT EXISTS (SELECT 1 FROM sys_menus WHERE id = 2);
  12. -- INSERT INTO sys_menus (`id`, `menu_id`, `name`, `url`, `perms`, `type`, `path`, `refresh`, `icon`, `sort_number`, `created_at`, `updated_at`)
  13. -- SELECT 3, 1, '员工账号', 'views/system/user/index.vue', NULL, '2', 'system-user', "0", NULL, 2, '2024-09-13 08:44:15', '2024-09-13 08:44:15'
  14. -- WHERE NOT EXISTS (SELECT 1 FROM sys_menus WHERE id = 3);
  15. -- INSERT INTO sys_menus (`id`, `menu_id`, `name`, `url`, `perms`, `type`, `path`, `refresh`, `icon`, `sort_number`, `created_at`, `updated_at`)
  16. -- SELECT 4, 1, '角色权限', 'views/system/role/index.vue', NULL, '2', 'system-role', "0", NULL, 3, '2024-09-13 08:45:03', '2024-09-13 08:45:03'
  17. -- WHERE NOT EXISTS (SELECT 1 FROM sys_menus WHERE id = 4);
  18. -- -- 添加一个角色
  19. -- INSERT INTO role (id, name, description, created_at, updated_at)
  20. -- SELECT 1, '管理员', '平台管理员', '2024-09-13 15:57:44', '2024-09-13 15:57:47'
  21. -- WHERE NOT EXISTS (SELECT id FROM role LIMIT 1);
  22. -- 添加初始化角色和账号关系
  23. -- INSERT INTO sys_user_roles (`id`, `user_id`, `role_id`, `created_at`, `updated_at`)
  24. -- SELECT 1, 1, 1, '2024-09-13 16:15:41', '2024-09-13 08:15:44'
  25. -- WHERE NOT EXISTS (SELECT id FROM sys_user_roles LIMIT 1);
  26. -- 添加角色与菜单绑定
  27. -- INSERT INTO sys_role_menus (`id`, `role_id`, `menu_id`, `created_at`, `updated_at`)
  28. -- SELECT 1, 1, 1, '2024-09-13 08:47:55', '2024-09-13 08:47:55'
  29. -- WHERE NOT EXISTS (SELECT id FROM sys_role_menus LIMIT 1);
  30. -- INSERT INTO sys_role_menus (`id`, `role_id`, `menu_id`, `created_at`, `updated_at`)
  31. -- SELECT 2, 1, 2, '2024-09-13 08:47:55', '2024-09-13 08:47:55'
  32. -- WHERE NOT EXISTS (SELECT 1 FROM sys_role_menus WHERE id = 2);
  33. -- INSERT INTO sys_role_menus (`id`, `role_id`, `menu_id`, `created_at`, `updated_at`)
  34. -- SELECT 3, 1, 3, '2024-09-13 08:47:55', '2024-09-13 08:47:55'
  35. -- WHERE NOT EXISTS (SELECT 1 FROM sys_role_menus WHERE id = 3);
  36. -- INSERT INTO sys_role_menus (`id`, `role_id`, `menu_id`, `created_at`, `updated_at`)
  37. -- SELECT 4, 1, 4, '2024-09-13 08:47:55', '2024-09-13 08:47:55'
  38. -- WHERE NOT EXISTS (SELECT 1 FROM sys_role_menus WHERE id = 4);