فهرست منبع

添加当前用户修改密码功能接口

DuGuYang 2 سال پیش
والد
کامیت
0d7a0747cc
1فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 6 4
      Areas/Api/Controllers/SysAdminController.cs

+ 6 - 4
Areas/Api/Controllers/SysAdminController.cs

@@ -115,6 +115,8 @@ namespace MySystem.Areas.Api.Controllers.v1
 
 
         #region 修改当前操作人密码
+        [Authorize]
+        [Route("/v1/qrcodeplatemain/sysadmin/changeloginpassword")]
         public JsonResult ChangeLoginPassword(string value)
         {
             value = PublicFunction.DesDecrypt(value);
@@ -125,19 +127,19 @@ namespace MySystem.Areas.Api.Controllers.v1
             string NewPassword2 = jsonObj["NewPassword2"].ToString(); //确认新密码
             if (string.IsNullOrEmpty(OldPassword))
             {
-                return Json(new AppResultJson() { Status = "1", Info = "成功" });
+                return Json(new AppResultJson() { Status = "-1", Info = "旧密码不能为空" });
             }
             if (string.IsNullOrEmpty(NewPassword))
             {
-                return Json(new AppResultJson() { Status = "1", Info = "成功" });
+                return Json(new AppResultJson() { Status = "-1", Info = "新密码不能为空" });
             }
             if (string.IsNullOrEmpty(NewPassword2))
             {
-                return Json(new AppResultJson() { Status = "1", Info = "成功" });
+                return Json(new AppResultJson() { Status = "-1", Info = "确认新密码不能为空" });
             }
             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();
             if (sysAdmin.Id > 0)