Ejemplo n.º 1
0
        public ActionResult ChangeUserPassword()
        {
            UserRequest request = new UserRequest(HttpContext);
            var user = CurrentParemeter.GetCurrentUser();
            var status = false;
            var md5Pwd = MD5Provider.Hash(request.OldUserPwd);
            if (md5Pwd != user.UserPwd)
            {
                return this.JsonFormatError(T("PwdError", true));
            }

            status = _userService.ChangePassword(user.UserID, request.NewUsrPwd);
            //TODO:test
            return this.JsonFormat(status, status, SysOperate.Operate);
        }
Ejemplo n.º 2
0
        public ActionResult LoginAndRedirect()
        {
            UserRequest request = new UserRequest(HttpContext);
            bool isError=true;
            var result = _userService.LoginVerify(request.CorporateID, request.UserCode, request.UserPwd);
            var message= FriendlyMessage.ToMessage(result);
            if (result == UserMessage.UserLoginSuccess)
            {
                isError = false;
                CurrentParemeter.SetCurrentCorp(request.CorporateID);
                CurrentParemeter.SetCurrentUser(request.UserCode);

                //写操作日志
                string logmsg = string.Format("用户[{0}]登陆[{1}]成功!",
                    CurrentParemeter.GetCurrentUser().UserCode,
                    CurrentParemeter.GetCurrentCorporate().CorporateCode);

                string controlName = RouteData.Values["controller"].ToString();
                string actionName = RouteData.Values["action"].ToString();
                string desc = "";

                LogOP(controlName, actionName, desc, logmsg, "");
            }
            else
            {
                isError = true;
            }
            //var data = new { Result = status,
            //    Title=_localizedViewService.LoadCommonPrompt(request.CorporateID,"Error"),
            //    Message = FriendlyMessage.ToMessage(result) };
            //return Json(data,"text/html");
            return this.JsonFormat(isError, isError, message);
               // return this.JsonFormat(status,!status, FriendlyMessage.ToMessage(result));
        }