|
|
@@ -114,6 +114,44 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
+ #region 修改当前操作人密码
|
|
|
+ public JsonResult ChangeLoginPassword(string value)
|
|
|
+ {
|
|
|
+ value = PublicFunction.DesDecrypt(value);
|
|
|
+ JsonData jsonObj = JsonMapper.ToObject(value);
|
|
|
+ int SysAdminId = int.Parse(jsonObj["SysAdminId"].ToString()); //系统用户Id
|
|
|
+ string OldPassword = jsonObj["OldPassword"].ToString(); //旧密码
|
|
|
+ string NewPassword = jsonObj["NewPassword"].ToString(); //新密码
|
|
|
+ string NewPassword2 = jsonObj["NewPassword2"].ToString(); //确认新密码
|
|
|
+ if (string.IsNullOrEmpty(OldPassword))
|
|
|
+ {
|
|
|
+ return Json(new AppResultJson() { Status = "1", Info = "成功" });
|
|
|
+ }
|
|
|
+ if (string.IsNullOrEmpty(NewPassword))
|
|
|
+ {
|
|
|
+ return Json(new AppResultJson() { Status = "1", Info = "成功" });
|
|
|
+ }
|
|
|
+ if (string.IsNullOrEmpty(NewPassword2))
|
|
|
+ {
|
|
|
+ return Json(new AppResultJson() { Status = "1", Info = "成功" });
|
|
|
+ }
|
|
|
+ if (NewPassword != NewPassword2)
|
|
|
+ {
|
|
|
+ return Json(new AppResultJson() { Status = "1", Info = "成功" });
|
|
|
+ }
|
|
|
+ var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.Id == SysAdminId && m.Password == function.MD5_32(OldPassword)) ?? new SysAdmin();
|
|
|
+ if (sysAdmin.Id > 0)
|
|
|
+ {
|
|
|
+ if (NewPassword == NewPassword2)
|
|
|
+ {
|
|
|
+ sysAdmin.Password = function.MD5_32(NewPassword);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ bsdb.SaveChanges();
|
|
|
+ return Json(new AppResultJson() { Status = "1", Info = "成功" });
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
|
|
|
#region 权限树
|
|
|
public JsonResult AuthsTree(string value)
|