|
@@ -115,6 +115,8 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 修改当前操作人密码
|
|
#region 修改当前操作人密码
|
|
|
|
|
+ [Authorize]
|
|
|
|
|
+ [Route("/v1/qrcodeplatemain/sysadmin/changeloginpassword")]
|
|
|
public JsonResult ChangeLoginPassword(string value)
|
|
public JsonResult ChangeLoginPassword(string value)
|
|
|
{
|
|
{
|
|
|
value = PublicFunction.DesDecrypt(value);
|
|
value = PublicFunction.DesDecrypt(value);
|
|
@@ -125,19 +127,19 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
string NewPassword2 = jsonObj["NewPassword2"].ToString(); //确认新密码
|
|
string NewPassword2 = jsonObj["NewPassword2"].ToString(); //确认新密码
|
|
|
if (string.IsNullOrEmpty(OldPassword))
|
|
if (string.IsNullOrEmpty(OldPassword))
|
|
|
{
|
|
{
|
|
|
- return Json(new AppResultJson() { Status = "1", Info = "成功" });
|
|
|
|
|
|
|
+ return Json(new AppResultJson() { Status = "-1", Info = "旧密码不能为空" });
|
|
|
}
|
|
}
|
|
|
if (string.IsNullOrEmpty(NewPassword))
|
|
if (string.IsNullOrEmpty(NewPassword))
|
|
|
{
|
|
{
|
|
|
- return Json(new AppResultJson() { Status = "1", Info = "成功" });
|
|
|
|
|
|
|
+ return Json(new AppResultJson() { Status = "-1", Info = "新密码不能为空" });
|
|
|
}
|
|
}
|
|
|
if (string.IsNullOrEmpty(NewPassword2))
|
|
if (string.IsNullOrEmpty(NewPassword2))
|
|
|
{
|
|
{
|
|
|
- return Json(new AppResultJson() { Status = "1", Info = "成功" });
|
|
|
|
|
|
|
+ return Json(new AppResultJson() { Status = "-1", Info = "确认新密码不能为空" });
|
|
|
}
|
|
}
|
|
|
if (NewPassword != NewPassword2)
|
|
if (NewPassword != NewPassword2)
|
|
|
{
|
|
{
|
|
|
- return Json(new AppResultJson() { Status = "1", Info = "成功" });
|
|
|
|
|
|
|
+ return Json(new AppResultJson() { Status = "-1", Info = "新密码和确认新密码不一致" });
|
|
|
}
|
|
}
|
|
|
var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.Id == SysAdminId && m.Password == function.MD5_32(OldPassword)) ?? new SysAdmin();
|
|
var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.Id == SysAdminId && m.Password == function.MD5_32(OldPassword)) ?? new SysAdmin();
|
|
|
if (sysAdmin.Id > 0)
|
|
if (sysAdmin.Id > 0)
|