Ejemplo n.º 1
0
 /// <summary>
 /// 登录
 /// 1000: 登录成功
 /// 1001: 登录失败
 /// 1002: 验证码过期
 /// 1003:验证码错误
 /// </summary>
 /// <param name="userName"></param>
 /// <param name="passWord"></param>
 /// <returns></returns>
 public ActionResult Login(string userName, string passWord, string code)
 {
     //string valCode=SessionHelper.Get("ValCode");
     //if (valCode.IsEmpty())
     //{
     //    return Content("1002");
     //}
     //if (valCode.ToLower()!=code.ToLower())
     //{
     //    return Content("1003");
     //}
     AdminProvider provider = new AdminProvider();
     AdminEntity entity = provider.Login(userName, passWord);
     if (entity != null)
     {
         this.LoginUser = entity;
         provider.UpdateLoginCount(entity.UserName, entity.PassWord, entity.LoginCount);
         return Content("1000");
     }
     return Content("1001");
 }
Ejemplo n.º 2
0
 public ActionResult ChangePwd(string currentPassword, string passWord)
 {
     AdminProvider provider = new AdminProvider();
     AdminEntity entity = provider.Login(this.LoginUser.UserName, currentPassword);
     int line = 0;
     if (entity.IsNotNull())
     {
         entity.PassWord = passWord;
         line = provider.UpdatePwd(entity);
     }
     if (line > 0)
     {
         this.ReturnJson.AddProperty("d", "success");
     }
     else
     {
         this.ReturnJson.AddProperty("d", "");
     }
     return Content(this.ReturnJson.ToString());
 }