Example #1
0
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <returns></returns>
        //[HttpPost]
        public ActionResult ModifyPasswordPage()
        {
            string account = Request["account"];
            string pwd     = Request["pwd"];

            //string account = "164804073";
            //string pwd = "01234567890";
            //userNickName = "小灰灰";
            if (account != null && pwd != null)
            {
                try
                {
                    var  userInfo = userService.FindNickName(account).FirstOrDefault();
                    user users    = new user();
                    users.ID                    = userInfo.ID;
                    users.vcUserAccount         = userInfo.vcUserAccount;
                    users.vcNickName            = userInfo.vcNickName;
                    users.vcProfilePhotoAddress = userInfo.vcProfilePhotoAddress;
                    users.iWeChatID             = userInfo.iWeChatID;
                    users.IsDel                 = userInfo.IsDel;
                    users.vcPassWord            = pwd;
                    try
                    {
                        if (userService.EditEntity(users))
                        {
                            mess   = "修改成功";
                            status = "ok";
                        }
                        else
                        {
                            mess   = "修改失败";
                            status = "fail";
                        }
                    }
                    catch (Exception ex)
                    {
                        mess   = "网络连接不稳定,请稍后再试" + ex.ToString();
                        status = "fail";
                    }
                }
                catch (Exception)
                {
                    mess   = "网络连接不稳定,请稍后再试";
                    status = "fail";
                }
            }
            else
            {
                mess   = "账号不存在";
                status = "fail";
            }
            result = "{" + "\"" + "status" + "\"" + ":" + "\"" + status + "\"" + "," + "\"" + "msg" + "\"" + ":" + "\"" + mess + "\"" + "}";
            return(Content(result));
        }