mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
修复用户名可重复的BUG
This commit is contained in:
parent
b31ea86fc3
commit
7933266e15
@ -115,6 +115,10 @@ namespace OpenAuth.App
|
||||
User user = view;
|
||||
if (user.Id == 0)
|
||||
{
|
||||
if (_repository.IsExist(u => u.Account == view.Account))
|
||||
{
|
||||
throw new Exception("用户账号已存在");
|
||||
}
|
||||
user.CreateTime = DateTime.Now;
|
||||
user.Password = user.Account; //初始密码与账号相同
|
||||
_repository.Add(user);
|
||||
|
Loading…
Reference in New Issue
Block a user