Commit fac326fa authored by 吴春's avatar 吴春

剧院修改

parent d45dd4c4
......@@ -25,7 +25,7 @@ namespace EheMall.Business.Handlers
[AutofacResolve]
private IRepository<EHECD_PhoneMsg> _repository { get; set; }
//private IUnitOfWork _unitOfWork { get; set; }
[AutofacResolve]
private IPhoneMsgService phoneMsgService { get; set; }
[AutofacResolve]
......@@ -78,9 +78,9 @@ namespace EheMall.Business.Handlers
GetPhoneMsgList();
}
/// <summary>
/// 修改验证码的状态(需先效验验证码的状态)
......@@ -173,22 +173,22 @@ namespace EheMall.Business.Handlers
}
else if (eventData.iType == 1003)
{
var model = userService.Get(eventData.UserID);
if (model == null)
//var model = userService.Get(eventData.UserID);
//if (model == null)
//{
// bResult = false;
// eventData.bResult = bResult;
// eventData.sMessage = "手机号码不存在";
//}
//else {
if (string.IsNullOrWhiteSpace(sPhone))
{
bResult = false;
eventData.bResult = bResult;
eventData.sMessage = "手机号码不存在";
}
else {
if (string.IsNullOrWhiteSpace(model.sPhone))
{
bResult = false;
eventData.bResult = bResult;
eventData.sMessage = "手机号码不存在";
}
}
TypeStr = "SMS_132045009";
//}
TypeStr = "SMS_160490358";
}
else if (eventData.iType == 1004)
{
......@@ -199,21 +199,22 @@ namespace EheMall.Business.Handlers
eventData.bResult = bResult;
eventData.sMessage = "手机号码不存在";
}
TypeStr = "SMS_150170938";
TypeStr = "SMS_160480454";
}
if (bResult)
{
try
{
if (eventData.iType <= 1003)
{
Business.Services.SMSService.SendMsg(eventData.sPhone, eventData.sCode, TypeStr);
}
else {
else
{
Business.Services.SMSService.SendCode(eventData.sPhone, eventData.sCode, TypeStr);
}
var entity = eventData.Map<EHECD_PhoneMsg>();
//entity.sCode = sCode;
entity.dAddTime = DateTime.Now;
......@@ -230,7 +231,7 @@ namespace EheMall.Business.Handlers
eventData.sMessage = "短信发送失败";
}
//SendMsgCommand command = new SendMsgCommand()
//{
// sPhone = sPhone,
......
......@@ -65,7 +65,7 @@ namespace EheMall.Business.Handlers
//RNGCryptoServiceProvider csp = new RNGCryptoServiceProvider();
//byte[] byteCsp = new byte[2];
//csp.GetBytes(byteCsp);
entity.CollectingTickets = (DateTime.UtcNow - new DateTime(2019, 3, 1, 0, 0, 0, 0)).TotalMilliseconds.ToString("f0"); // GetWeekNow() +BitConverter.ToString(byteCsp).Replace("-", "");
entity.CollectingTickets = Guid.NewGuid().ToString().Substring(27, 8).ToUpper();//(DateTime.UtcNow - new DateTime(2019, 3, 1, 0, 0, 0, 0)).TotalMilliseconds.ToString("f0"); // GetWeekNow() +BitConverter.ToString(byteCsp).Replace("-", "");
entity.iBuyID = eventData.iLogUserId;
entity.iBuyCount = eventData.ParticularlyNum + eventData.FirstNum + eventData.ScondNum + eventData.ThirdNum;
entity.TotalPrice = eventData.TotalPrice;
......@@ -84,7 +84,7 @@ namespace EheMall.Business.Handlers
}
var msg = new CheckCodeSendCommand()
{
sCode = eventData.SucceedInfo + "下单成功,取票码:" + entity.CollectingTickets,
sCode = $@"‘{ eventData.SucceedInfo + "下单成功,取票码:" + entity.CollectingTickets}'",
iType = 1004,
sPhone = eventData.Mobile,
sKey = Helpers.PhoneMsgHelper.GenerateKey()
......
......@@ -33,7 +33,7 @@ namespace EheMall.Business.Services
obj["cmd"] = "sms";
obj["phoneNumber"] = phoneNumber;
obj["templateCode"] = templateCode;
var TemplateParam = new { content };
var TemplateParam = new { code= content };
obj["templateParam"] = JsonConvert.SerializeObject(TemplateParam);
QueueHelper.EnqueueTask(JsonConvert.SerializeObject(obj));
}
......
......@@ -337,7 +337,7 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
{
if (CurrentClient == null)
{
return Redirect("/TicketMall/Login/Index");
return Json(new { valid = false, message = "登录信息过期,请重新登录" });
}
if (Request.IsAjaxRequest())
{
......@@ -379,14 +379,14 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
var msg = new CheckCodeSendCommand()
{
UserID = theaterModel.iPrincipalID,
sCode = entity.SucceedInfo + "甲票已售罄",
sCode = $@"‘{ entity.SucceedInfo + "甲票不足"}",
iType = 1003,
sPhone = theaterModel.sPhone,
sKey = Helpers.PhoneMsgHelper.GenerateKey()
};
EngineContext.Current.ResolveOptional<Events.IEventBus>().Publish(msg);
}
return Json(new { valid = false, message = "甲票已售罄" });
return Json(new { valid = false, message = "甲票不足" });
}
entity.OrderDetail.FirstNum = entity.FirstNum;
entity.OrderDetail.FirstPrice = modelPrice.FirstPrice;
......@@ -428,14 +428,14 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
var msg = new CheckCodeSendCommand()
{
UserID = theaterModel.iPrincipalID,
sCode = entity.SucceedInfo + "特票已售罄",
sCode = $@"‘{ entity.SucceedInfo + "特票不足"}",
iType = 1003,
sPhone = theaterModel.sPhone,
sKey = Helpers.PhoneMsgHelper.GenerateKey()
};
EngineContext.Current.ResolveOptional<Events.IEventBus>().Publish(msg);
}
return Json(new { valid = false, message = "特票已售罄" });
return Json(new { valid = false, message = "特票不足" });
}
entity.OrderDetail.ParticularlyNum = entity.ParticularlyNum;
entity.OrderDetail.ParticularlyPrice = modelPrice.ParticularlyPrice;
......@@ -476,14 +476,14 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
var msg = new CheckCodeSendCommand()
{
UserID = theaterModel.iPrincipalID,
sCode = entity.SucceedInfo + "乙票已售罄",
sCode = $@"‘{ entity.SucceedInfo + "乙票不足"}",
iType = 1003,
sPhone = theaterModel.sPhone,
sKey = Helpers.PhoneMsgHelper.GenerateKey()
};
EngineContext.Current.ResolveOptional<Events.IEventBus>().Publish(msg);
}
return Json(new { valid = false, message = "乙票已售罄" });
return Json(new { valid = false, message = "乙票不足" });
}
entity.OrderDetail.ScondNum = entity.ScondNum;
entity.OrderDetail.ScondPrice = modelPrice.ScondPrice;
......@@ -524,14 +524,14 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
var msg = new CheckCodeSendCommand()
{
UserID = theaterModel.iPrincipalID,
sCode = entity.SucceedInfo + "丙票已售罄",
sCode = $@"‘{ entity.SucceedInfo + "丙票不足"}",
iType = 1003,
sPhone = theaterModel.sPhone,
sKey = Helpers.PhoneMsgHelper.GenerateKey()
};
EngineContext.Current.ResolveOptional<Events.IEventBus>().Publish(msg);
}
return Json(new { valid = false, message = "丙票已售罄" });
return Json(new { valid = false, message = "丙票不足" });
}
entity.OrderDetail.ThirdNum = entity.ThirdNum;
entity.OrderDetail.ThirdPrice = modelPrice.ThirdPrice;
......@@ -727,15 +727,7 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
public ActionResult SendCode(int Type)
{
//string code = CreateRandomCode(4);
//if (Type == 1)//修改手机号码
//{
// Session["UpdateMobileCode"] = code;
//}
//else
//{//修改密码
// Session["ModifyPWCode"] = code;
//}
//Member member = CurrentClient;
//Business.Services.SMSService.SendCode(member.MobilePhone, code, "SMS_132045009");
if (CurrentClient == null)
......@@ -754,6 +746,14 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
CodeType = 1001;
}
string sCode = StringExtensions.GenerateRandomDigitCode(5);
if (Type == 1)//修改手机号码
{
Session["UpdateMobileCode"] = sCode;
}
else
{//修改密码
Session["ModifyPWCode"] = sCode;
}
result.RunWithTry(x =>
{
var msg = new CheckCodeSendCommand()
......@@ -788,15 +788,15 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
{
return Json(new { valid = false, message = "请输入验证吗" });
}
////验证code
//if (Session["ModifyPWCode"] == null)
//{
// return Json(new { valid = false, message = "验证码超时,请重新发送" });
//}
//if (Session["ModifyPWCode"].ToString() != entity.SecurityCode)
//{
// return Json(new { valid = false, message = "验证码输入不正确" });
//}
//验证code
if (Session["ModifyPWCode"] == null)
{
return Json(new { valid = false, message = "验证码超时,请重新发送" });
}
if (Session["ModifyPWCode"].ToString() != entity.SecurityCode)
{
return Json(new { valid = false, message = "验证码输入不正确" });
}
if (string.IsNullOrWhiteSpace(entity.PassWord))
{
......@@ -816,9 +816,10 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
return Json(new { valid = false, message = "密码不能跟现在一样" });
}
entity.Type = 1002;
member.PassWord = entity.PassWord.Trim().MD5();
//member.PassWord = entity.PassWord.Trim().MD5();
this._eventBus.Publish(entity);
Session["Member"] = member;
Session["Member"] = null;
return Json(new { valid = true, message = "操作成功" });
}
catch (Exception ex)
......@@ -850,10 +851,10 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
{
return Json(new { valid = false, message = "验证码超时,请重新发送" });
}
//if (Session["UpdateMobileCode"].ToString() != entity.SecurityCode)
//{
// return Json(new { valid = false, message = "验证码输入不正确" });
//}
if (Session["UpdateMobileCode"].ToString() != entity.SecurityCode)
{
return Json(new { valid = false, message = "验证码输入不正确" });
}
if (string.IsNullOrWhiteSpace(entity.MobilePhone))
{
......
......@@ -58,7 +58,7 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
{
try
{
EngineContext.Current.Resolve<IAuthenticate>().SignOut();
//EngineContext.Current.Resolve<IAuthenticate>().SignOut();
Session["Member"] = null;
return Json(new { valid = true, message = "退出成功" });
}
......
......@@ -211,7 +211,18 @@
});
} else {
$(".Ticket_sureBtn").attr("onclick", "SaveOrder(this);");
layer.msg(data.message, { icon: 2 });
if (data.message == "登录信息过期,请重新登录") {
layer.msg(data.message, {
icon: 2,//提示的样式
end: function () {
location.href = "@Url.Action("Index", "Login")";
}
});
}
else {
layer.msg(data.message, { icon: 2 });
}
}
}
});
......
......@@ -231,11 +231,11 @@
</div>
<div class="buyTicket">
<span class="Ticket_Total">新密码</span>
<input type="text" placeholder="密码为6-12位字母数字组成" class="ticket_input" name="PassWord" id="PassWord" />
<input type="password" placeholder="密码为6-12位字母数字组成" class="ticket_input" name="PassWord" id="PassWord" />
</div>
<div class="buyTicket">
<span class="Ticket_Total">再次输入密码</span>
<input type="text" class="ticket_input" id="ValidataPW" />
<input type="password" class="ticket_input" id="ValidataPW" />
</div>
<div>
<input type="button" class="Ticket_sureBtn" value="确认" id="UpdatePW" />
......@@ -341,10 +341,15 @@
data: { "SecurityCode": SecurityCode, "PassWord": PassWord},
success: function (data) {
if (data.valid) {
layer.msg('修改成功', { icon: 1 });
$("#SecurityCode").val("");
$("#PassWord").val("");
$("#ValidataPW").val("");
layer.msg('修改成功', {
icon: 1,//提示的样式
end: function () {
location.href = "@Url.Action("Index","Login")";
}
});
//$("#SecurityCode").val("");
//$("#PassWord").val("");
//$("#ValidataPW").val("");
} else {
layer.msg(data.message, { icon: 2 });
//$("#SecurityCode").val("");
......@@ -381,6 +386,8 @@
data: { "SecurityCode": MobileCode, "MobilePhone": MobilePhone},
success: function (data) {
if (data.valid) {
layer.msg('修改成功', { icon: 1 });
$("#MobileCode").val("");
$("#MobilePhone").val("");
......
......@@ -20,7 +20,7 @@
<authentication mode="Forms">
<forms cookieless="UseDeviceProfile" loginUrl="/Admin/Home/Login" defaultUrl="/Admin/Home" />
</authentication>
<sessionState mode="InProc" cookieless="false" timeout="20" />
<sessionState mode="InProc" cookieless="false" timeout="30" />
<!--<sessionState mode="SQLServer" sqlCommandTimeout="120" sqlConnectionString="data source=.;User = sa; Password =123456" cookieless="false" timeout="120" />-->
<customErrors mode="On" defaultRedirect="~/ErrorPage/404.htm">
</customErrors>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment