public ActionResult Edit([FromQuery] uint Member_id) { Member_securityInfo item = Member_security.GetItem(Member_id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } ViewBag.item = item; return(View()); }
public APIReturn _Edit([FromQuery] uint Member_id, [FromForm] string Password) { Member_securityInfo item = Member_security.GetItem(Member_id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } item.Password = Password; int affrows = Member_security.Update(item); if (affrows > 0) { return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}")); } return(APIReturn.失败); }
public APIReturn login(RegisterModel model, [FromForm] string vcode) { var item = Member.Select.Where("a.username = {0} or a.telphone = {0} or a.email = {0}", model.Username).ToOne(); if (item == null) { return(APIReturn.用户不存在); } var security = Member_security.GetItem(item.Id.Value); string sha256 = Convert.ToBase64String(SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(model.Password))); if (security.Password != sha256) { return(APIReturn.用户名或密码错误); } Session.SetInt32("_memberid", (int)item.Id); return(APIReturn.成功); }