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