Esempio n. 1
0
        public ResData UpUserInfo([FromForm] string pwd, [FromForm] string pwdOld, [FromForm] string Code)
        {
            var user = "";

            user = GetCookies("userid");
            if (user != "")
            {
                var li = EF.UserInfos.FirstOrDefault(a => a.UserID == user);
                //var Pwd = MD5Helper.EncryptString(pwd);

                //var PwdOld = MD5Helper.EncryptString(pwdOld);

                if (li.PassWord == pwdOld)
                {
                    if (Code == GetCookies("yz"))
                    {
                        var up = personalI.UpdataUser(pwd, user);
                        return(GetUser());
                    }
                    else
                    {
                        return(ResData.Succ(_msg: "验证码错误"));
                    }
                }
                else
                {
                    return(ResData.Succ(_msg: "密码错误"));
                }
            }
            else
            {
                return(ResData.Fail());
            }
        }
Esempio n. 2
0
        public object Yz(string email)
        {
            var userid = "";

            if (GetCookies("userid") != "")
            {
                userid = GetCookies("userid");
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
            Random random    = new Random(Guid.NewGuid().GetHashCode());
            string intString = random.Next(1000, 9999).ToString();

            HttpContext.Response.Cookies.Append("yz", intString, new CookieOptions
            {
                Expires = DateTime.Now.AddMinutes(3)
            });
            // 确定smtp服务器地址 实例化一个Smtp客户端
            SmtpClient client = new SmtpClient();

            client.Host = options.Value.Host;
            // 确定发件地址与收件地址
            MailAddress sendAddress    = new MailAddress(options.Value.Address, options.Value.Name, System.Text.Encoding.Default);
            MailAddress receiveAddress = new MailAddress(email);
            // 构造一个Email的Message对象 内容信息
            MailMessage mailMessage = new MailMessage(sendAddress, receiveAddress);

            mailMessage.Subject         = "登陆验证码";
            mailMessage.SubjectEncoding = System.Text.Encoding.UTF8;
            mailMessage.IsBodyHtml      = true;
            mailMessage.Body            = "嗨喽,终于等到您啦!<br/><br/>欢迎修改宁的邮箱密码,您的验证码为:<span style=font-weight:bold;font-size:18px;'>" + intString + "</span><br/>(5分钟内有效)<br/><br/>工作人员不会向您索要密码、验证码等信息。如非本人操作,请联系我们或忽略本条信息。<br/><br/>";
            mailMessage.BodyEncoding    = System.Text.Encoding.UTF8;
            mailMessage.Priority        = MailPriority.Low;//优先级
            // 邮件发送方式  通过网络发送到smtp服务器
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            // 如果服务器支持安全连接,则将安全连接设为true
            client.EnableSsl = true;
            try
            {
                // 是否使用默认凭据,若为false,则使用自定义的证书,就是下面的networkCredential实例对象
                client.UseDefaultCredentials = false;
                // 指定邮箱账号和密码,需要注意的是,这个密码是你在QQ邮箱设置里开启服务的时候给你的那个授权码
                NetworkCredential networkCredential = new NetworkCredential(options.Value.Address, options.Value.Password);
                client.Credentials = networkCredential;
                // 发送邮件
                client.Send(mailMessage);

                return(ResData.Succ("发送成功"));
            }
            catch
            {
                return(ResData.Fail("发送失败"));
            }
        }
Esempio n. 3
0
        public ResData Regi([FromForm] UserInfo user, [FromForm] string yz)
        {
            var sds = GetCookies("yz");

            if (yz != sds)
            {
                return(ResData.Succ());
            }
            return(ResData.Succ());
        }
Esempio n. 4
0
        public ResData meiyoude([FromForm] string list)
        {
            //Newtonsoft.Json

            var a4 = Newtonsoft.Json.JsonConvert.DeserializeObject <List <ShoppingCar> >(list);



            return(ResData.Succ(list));
        }
Esempio n. 5
0
 public object Test([FromForm] string token)
 {
     if (LoginUser == null)
     {
         return(ResData.Fail());
     }
     else
     {
         return(ResData.Succ());
     }
 }
Esempio n. 6
0
        public ResData Login([FromForm] string userId, [FromForm] string pwd)
        {
            var li = logingService.GetLogin(userId, pwd);

            if (li != null)
            {
                HttpContext.Response.Cookies.Append("userid", userId, options: new CookieOptions()
                {
                    Expires = DateTime.Now.AddHours(0.5)
                });
            }
            return(ResData.Succ(li));
        }
Esempio n. 7
0
        public ResData GetShoppingAddress()
        {
            var user = "";

            user = GetCookies("userid");
            if (user != "")
            {
                var list = personalI.GetShoppingAddress(user);
                return(ResData.Succ(list));
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
        }
Esempio n. 8
0
        public ResData GetUser()
        {
            var user = "";

            user = GetCookies("userid");
            if (user != "")
            {
                var li = personalI.GetUser(user);
                return(ResData.Succ(li));
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
        }
Esempio n. 9
0
        public object Login([FromForm] string name, [FromForm] string pwd)
        {
            UserOutput entity = accountService.Login(name, pwd);

            if (entity != null)
            {
                var token = Guid.NewGuid().ToString("N");
                SetUser(token, entity);
                return(ResData.Succ(token));
            }
            else
            {
                return(ResData.Fail("账号或密码错误"));
            }
        }
Esempio n. 10
0
        public ResData IntoShoppingCar([FromForm] string goodid = "G1001", [FromForm] string specificationarr = "GS1004,GS1001", [FromForm] decimal price = 5999)
        {
            var userid = "";

            if (GetCookies("userid") != "")
            {
                userid = GetCookies("userid");
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
            var list = shopping.IntoShoppingCar(goodid, userid, specificationarr, price);

            return(ResData.Succ(list));
        }
Esempio n. 11
0
        public ResData ShiooingCarList()
        {
            var userid = "";

            if (GetCookies("userid") != "")
            {
                userid = GetCookies("userid");
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
            var list = shopping.GetShoppingCarList(userid);

            return(ResData.Succ(list));
        }
Esempio n. 12
0
        public ResData ShiooingCarDelect([FromForm] string goodid)
        {
            var userid = "";

            if (GetCookies("userid") != "")
            {
                userid = GetCookies("userid");
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
            var list = shopping.ShoppingCarDelect(goodid, userid);

            return(ResData.Succ(list));
        }
Esempio n. 13
0
        public ResData fanShoppingCar([FromForm]  string goodid = "G1001")
        {
            var userid = "";

            if (GetCookies("userid") != "")
            {
                userid = GetCookies("userid");
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
            var list = shopping.fanShoppingCar(goodid, userid);

            return(ResData.Succ(list));
        }
Esempio n. 14
0
        public ResData GetSettlements(string orderid)
        {
            var userid = "";

            if (GetCookies("userid") != "")
            {
                userid = GetCookies("userid");
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
            var list = shopping.GetSettlementsList(userid, orderid);

            return(ResData.Succ(list));
        }
Esempio n. 15
0
        public ResData CreateOrderList([FromForm] string sett)
        {
            var userid = "";

            if (GetCookies("userid") != "")
            {
                userid = GetCookies("userid");
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
            var list = shopping.CreateOrder(userid, sett);

            return(ResData.Succ(list));
        }
Esempio n. 16
0
        public ResData ReplyComments([FromForm] string goodid, [FromForm] string commentid, [FromForm] string content)
        {
            var userid = "";

            if (GetCookies("userid") != "")
            {
                userid = GetCookies("userid");
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
            var list = details.ReplyComment(userid, goodid, commentid, content);

            return(ResData.Succ(list));
        }
Esempio n. 17
0
        public ResData GetPersonal(int?Type, int page = 1, int limte = 4)
        {
            var user = "";

            user = GetCookies("userid");
            if (user != "")
            {
                var li = personalI.GetGood_OrdersList(Type, page, limte, user);
                if (li.Count != 0)
                {
                    return(ResData.Succ(li));
                }
                else
                {
                    return(ResData.Succ(_msg: "暂时没有订单"));
                }
            }
            else
            {
                return(ResData.Fail("未登录"));
            }
        }
Esempio n. 18
0
        public ResData GetOutLineList(string goodid)
        {
            var list = details.GetOutLine(goodid);

            return(ResData.Succ(list));
        }
Esempio n. 19
0
        public ResData GetCoupons(string couponid)
        {
            var list = shopping.GetCoupon(couponid);

            return(ResData.Succ(list));
        }
Esempio n. 20
0
        public ResData ChangeOrderType([FromForm] string orderid)
        {
            var list = shopping.ChangeOrder(orderid);

            return(ResData.Succ(list));
        }
Esempio n. 21
0
        public ResData SettleBtnClick([FromForm] string orderid, [FromForm] User_AddressDTO addressmod, [FromForm] string couponid, [FromForm] decimal?totalPrice)
        {
            var list = shopping.SettleClick(orderid, addressmod, couponid, totalPrice);

            return(ResData.Succ(list));
        }
Esempio n. 22
0
        public ResData HomeTopList()
        {
            var list = home.HomeTopList();

            return(ResData.Succ(list));
        }
Esempio n. 23
0
        public ResData GetParameter(string parameterid)
        {
            var list = details.GetParameter(parameterid);

            return(ResData.Succ(list));
        }
Esempio n. 24
0
        public ResData GetOutLine(string outlineid)
        {
            var list = details.GetOutLine(outlineid);

            return(ResData.Succ(list));
        }
Esempio n. 25
0
        public ResData CagegoryHome()
        {
            var list = home.GetCagegoryHomes();

            return(ResData.Succ(list));
        }
Esempio n. 26
0
        public ResData GetGood(string goodid, string gsid)
        {
            var list = details.GetGood(goodid, gsid);

            return(ResData.Succ(list));
        }
Esempio n. 27
0
 public ResData OutLogin()
 {
     HttpContext.Response.Cookies.Delete("userid");
     return(ResData.Succ(null));
 }
Esempio n. 28
0
        public ResData FuzzyGood(string str, int page = 1, int limte = 10)
        {
            var list = home.GetFuzzyGood(str, page, limte);

            return(ResData.Succ(list));
        }
Esempio n. 29
0
        public ResData GetGoodComment(string goodid)
        {
            var list = details.GetGoodComment(goodid, 1, 10, null);

            return(ResData.Succ(list));
        }
Esempio n. 30
0
        public ResData GetBuyingGoodList(int page = 1, int limte = 8)
        {
            var list = home.GetBuyingGood(page, limte);

            return(ResData.Succ(list));
        }