修复用户名可重复的BUG

This commit is contained in:
yubaolee 2016-08-22 16:14:55 +08:00
parent b31ea86fc3
commit 7933266e15

View File

@ -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);