示例#1
0
        public void ProcessRequest(HttpContext context)
        {
            var resData = new OperationResult <CustomerLoginData>();
            var uid     = context.Request["id"] ?? "100002";
            var service = new CustomerBP();

            resData = service.GetUserById(new RequestOperation <int>()
            {
                Body   = int.Parse(uid),
                Header = new HeaderInfo()
                {
                }
            });
            if (resData.ErrCode == 0)
            {
                LoginManage.SaveUserInfo(resData.Body.UserID);
            }

            context.Response.Redirect("index.html");
        }
示例#2
0
        public void ProcessRequest(HttpContext context)
        {
            var resData = new OperationResult <CustomerLoginData>();

            var cookieUser = LoginManage.GetUId();

            //
            if (cookieUser <= 0)
            {
                resData.Message = "用户未登录";
            }
            else
            {
                var service = new CustomerBP();
                var res     = service.GetUserById(new RequestOperation <int>()
                {
                    Body   = cookieUser,
                    Header = new HeaderInfo()
                    {
                    }
                });
                if (res.ErrCode == 0)
                {
                    resData.Body = new CustomerLoginData()
                    {
                        UserID   = res.Body.UserID,
                        NickName = res.Body.NickName,
                        Name     = res.Body.Name,
                        Face     = res.Body.Face
                    };
                    resData.ErrCode = 0;
                }
            }
            context.Response.Write(JsonHelper.ReBuilder(resData));
            context.Response.End();
        }