/// <summary> /// 注册用户 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task RegisteredUsers(RegisterModel input) { var model = await UserRepository.FirstOrDefaultAsync(s => s.UserId == input.UserId); if (model != null) { throw new FailInfo("用户名已存在"); } await UserRepository.InsertAsync(new User() { UserId = input.UserId, PassWord = input.PassWord, PhoneNumber = input.PhoneNumber, Email = input.Email }); }
public async Task<ActionResult> Register(RegisterModel input) { ViewBag.Url = input.Url; if (ModelState.IsValid) { await AccountService.RegisteredUsers(input); throw new SuccessInfo("恭喜注册成功!", InfoForm.Alert, input.Url); } return View(); }