登录账户任意填写都能登录的BUG

This commit is contained in:
lijianyou
2025-10-14 22:17:46 +08:00
parent 04d2ab0eaa
commit 67e43c656b
4 changed files with 14 additions and 7 deletions
+9 -2
View File
@@ -50,9 +50,16 @@ namespace dy.net.repository
}
public async Task<LoginUserInfo> GetUser()
public async Task<LoginUserInfo> GetUser(string userName=null)
{
return await this.GetFirstAsync(x=>!string.IsNullOrWhiteSpace(x.Id));
if (string.IsNullOrWhiteSpace(userName))
{
return await this.GetFirstAsync(x=>!string.IsNullOrWhiteSpace(x.Id));
}
else
{
return await this.GetFirstAsync(x => x.UserName == userName);
}
}