Browse Source
Check if current `username` is `admin`.
pull/21906/head
maliming
1 year ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
6 additions and
5 deletions
-
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml
-
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs
|
|
|
@ -24,10 +24,10 @@ |
|
|
|
|
|
|
|
@if (Model.ShowRequireMigrateSeedMessage) |
|
|
|
{ |
|
|
|
<div class="alert alert-danger"> |
|
|
|
<h4 class="alert-heading">@L["RequireMigrateSeedTitle"]</h4> |
|
|
|
<p>@L["RequireMigrateSeedMessage"]</p> |
|
|
|
</div> |
|
|
|
<div class="alert alert-danger"> |
|
|
|
<h4 class="alert-heading">@L["RequireMigrateSeedTitle"]</h4> |
|
|
|
<p>@L["RequireMigrateSeedMessage"]</p> |
|
|
|
</div> |
|
|
|
} |
|
|
|
|
|
|
|
<div class="card mt-3 shadow-sm rounded"> |
|
|
|
|
|
|
|
@ -136,7 +136,8 @@ public class LoginModel : AccountPageModel |
|
|
|
|
|
|
|
if (!result.Succeeded) |
|
|
|
{ |
|
|
|
if (WebHostEnvironment.IsDevelopment()) |
|
|
|
if (LoginInput.UserNameOrEmailAddress == IdentityDataSeedContributor.AdminUserNameDefaultValue && |
|
|
|
WebHostEnvironment.IsDevelopment()) |
|
|
|
{ |
|
|
|
var adminUser = await UserManager.FindByNameAsync(IdentityDataSeedContributor.AdminUserNameDefaultValue); |
|
|
|
if (adminUser == null) |
|
|
|
|