SysUserSeedData.cs 1.3 KB

12345678910111213141516171819202122232425262728
  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
  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. new SysUser { Id = 2, SysOrgId = 1, Name = "超级管理员", Account = "admin", Password = "eqa6HHNRd1uyROxbndDR+A==:oQfe9PHl/WNLtxSNlCXo512AZbb7S0lxurBi5dNw9iI=", IsActivated = true, CreateSysUserId = 1, CreateTime = DateTime.Now, Status = CommonStatus.ENABLE },
  24. ];
  25. }
  26. }