SysUserSeedData.cs 1.0 KB

123456789101112131415161718192021222324252627
  1. using Furion.DatabaseAccessor;
  2. using Microsoft.EntityFrameworkCore;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace YBEE.EQM.Core.SeedData;
  6. /// <summary>
  7. /// 用户种子
  8. /// </summary>
  9. public class SysUserSeedData : IEntitySeedData<SysUser>
  10. {
  11. /// <summary>
  12. /// 种子数据
  13. /// </summary>
  14. /// <param name="dbContext"></param>
  15. /// <param name="dbContextLocator"></param>
  16. /// <returns></returns>
  17. public IEnumerable<SysUser> HasData(DbContext dbContext, Type dbContextLocator)
  18. {
  19. return new[]
  20. {
  21. new SysUser { Id = CommonConst.SYS_USER_ID, SysOrgId = 1, Name = "系统用户", Account = "sys", Password = "", IsActivated = true, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE },
  22. new SysUser { Id = 2, SysOrgId = 1, Name = "超级管理员", Account = "admin", Password = "5t6QUpK/gc29b2R83PGu/dMBr8qUIkRWpG9dhS85SnI=", IsActivated = true, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE },
  23. };
  24. }
  25. }