mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-02-18 06:06:24 +08:00
主页加载菜单按钮
重新修改了登陆逻辑
This commit is contained in:
@@ -9,10 +9,10 @@ namespace OpenAuth.Infrastructure.Mapping
|
||||
public UserMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.UserId);
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.UserId)
|
||||
this.Property(t => t.Id)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace OpenAuth.Infrastructure.Mapping
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("User");
|
||||
this.Property(t => t.UserId).HasColumnName("UserId");
|
||||
this.Property(t => t.Id).HasColumnName("UserId");
|
||||
this.Property(t => t.Account).HasColumnName("Account");
|
||||
this.Property(t => t.Password).HasColumnName("Password");
|
||||
this.Property(t => t.RealName).HasColumnName("RealName");
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace OpenAuth.Infrastructure.Repository
|
||||
{
|
||||
public class UserRepository :BaseRepository, IUserRepository
|
||||
{
|
||||
public User FindBy(string username)
|
||||
public User FindByAccount(string username)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -20,6 +20,18 @@ namespace OpenAuth.Infrastructure.Repository
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public User FindById(string id)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _Context.Users.First(e => e.Id == id);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user