public async Task <IActionResult> OnPostAsync() { var adminUserInfo = _accountInfoService.Init(out string userName, out string password);//初始化管理员信息 if (adminUserInfo == null) { return(new StatusCodeResult(404)); //base.Response.StatusCode = 404; //return; } else { Step = 1; _systemConfigService.Init();//初始化系统信息 _sysMenuService.Init(); IXscfRegister systemRegister = Senparc.Scf.XscfBase.Register.RegisterList.First(z => z.GetType() == typeof(Senparc.Areas.Admin.Register)); await _xscfModuleService.InstallMenuAsync(systemRegister, Scf.Core.Enums.InstallOrUpdate.Install);//安装菜单 AdminUserName = userName; AdminPassword = password;//这里不可以使用 adminUserInfo.Password,因为此参数已经是加密信息 return(Page()); } }
public async Task <IActionResult> OnPostAsync() { var adminUserInfo = _accountInfoService.Init(out string userName, out string password);//初始化管理员信息 if (adminUserInfo == null) { return(new StatusCodeResult(404)); } else { Step = 1; //添加初始化多租户信息 if (SiteConfig.SenparcCoreSetting.EnableMultiTenant) { var httpContext = _httpContextAccessor.Value.HttpContext; try { //var tenantInfo = await _tenantInfoService.CreateInitTenantInfoAsync(httpContext); CreatedRequestTenantInfo = await _tenantInfoService.SetScopedRequestTenantInfoAsync(httpContext); TenantInfoDto = _tenantInfoService.Mapper.Map <TenantInfoDto>(await _tenantInfoService.GetObjectAsync(z => z.Id == CreatedRequestTenantInfo.Id)); } catch (Exception) { } finally { } } _systemConfigService.Init();//初始化系统信息 _sysMenuService.Init(); IXncfRegister systemRegister = XncfRegisterManager.RegisterList.First(z => z.GetType() == typeof(Senparc.Areas.Admin.Register)); await _xncfModuleService.InstallMenuAsync(systemRegister, Ncf.Core.Enums.InstallOrUpdate.Install);//安装菜单 AdminUserName = userName; AdminPassword = password;//这里不可以使用 adminUserInfo.Password,因为此参数已经是加密信息 return(Page()); } }
public IActionResult OnGet() { _systemConfigService.Init(); //初始化系统信息 _sysMenuService.Init(); var adminUserInfo = _accountInfoService.Init(out string userName, out string password); //初始化管理员信息 if (adminUserInfo == null) { return(new StatusCodeResult(404)); base.Response.StatusCode = 404; //return; //return new StatusCodeResult(404); } else { AdminUserName = userName; AdminPassword = password;//这里不可以使用 adminUserInfo.Password,因为此参数已经是加密信息 return(Page()); } }