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()); } }
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("发送失败")); } }
public ResData Regi([FromForm] UserInfo user, [FromForm] string yz) { var sds = GetCookies("yz"); if (yz != sds) { return(ResData.Succ()); } return(ResData.Succ()); }
public ResData meiyoude([FromForm] string list) { //Newtonsoft.Json var a4 = Newtonsoft.Json.JsonConvert.DeserializeObject <List <ShoppingCar> >(list); return(ResData.Succ(list)); }
public object Test([FromForm] string token) { if (LoginUser == null) { return(ResData.Fail()); } else { return(ResData.Succ()); } }
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)); }
public ResData GetShoppingAddress() { var user = ""; user = GetCookies("userid"); if (user != "") { var list = personalI.GetShoppingAddress(user); return(ResData.Succ(list)); } else { return(ResData.Fail("未登录")); } }
public ResData GetUser() { var user = ""; user = GetCookies("userid"); if (user != "") { var li = personalI.GetUser(user); return(ResData.Succ(li)); } else { return(ResData.Fail("未登录")); } }
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("账号或密码错误")); } }
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)); }
public ResData ShiooingCarList() { var userid = ""; if (GetCookies("userid") != "") { userid = GetCookies("userid"); } else { return(ResData.Fail("未登录")); } var list = shopping.GetShoppingCarList(userid); return(ResData.Succ(list)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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("未登录")); } }
public ResData GetOutLineList(string goodid) { var list = details.GetOutLine(goodid); return(ResData.Succ(list)); }
public ResData GetCoupons(string couponid) { var list = shopping.GetCoupon(couponid); return(ResData.Succ(list)); }
public ResData ChangeOrderType([FromForm] string orderid) { var list = shopping.ChangeOrder(orderid); return(ResData.Succ(list)); }
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)); }
public ResData HomeTopList() { var list = home.HomeTopList(); return(ResData.Succ(list)); }
public ResData GetParameter(string parameterid) { var list = details.GetParameter(parameterid); return(ResData.Succ(list)); }
public ResData GetOutLine(string outlineid) { var list = details.GetOutLine(outlineid); return(ResData.Succ(list)); }
public ResData CagegoryHome() { var list = home.GetCagegoryHomes(); return(ResData.Succ(list)); }
public ResData GetGood(string goodid, string gsid) { var list = details.GetGood(goodid, gsid); return(ResData.Succ(list)); }
public ResData OutLogin() { HttpContext.Response.Cookies.Delete("userid"); return(ResData.Succ(null)); }
public ResData FuzzyGood(string str, int page = 1, int limte = 10) { var list = home.GetFuzzyGood(str, page, limte); return(ResData.Succ(list)); }
public ResData GetGoodComment(string goodid) { var list = details.GetGoodComment(goodid, 1, 10, null); return(ResData.Succ(list)); }
public ResData GetBuyingGoodList(int page = 1, int limte = 8) { var list = home.GetBuyingGood(page, limte); return(ResData.Succ(list)); }