Compare commits

...

1 Commits

4 changed files with 36 additions and 10 deletions

View File

@@ -1425,7 +1425,7 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
public string CheckRepeat(long employeeId, long workshopId) public string CheckRepeat(long employeeId, long workshopId)
{ {
var validSpan = new TimeSpan(0, 0, 2, 0); var validSpan = new TimeSpan(0, 0, 5, 0);
var checkDate = DateTime.Now.AddDays(-3); var checkDate = DateTime.Now.AddDays(-3);
var query = _context.RollCalls var query = _context.RollCalls
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.CreationDate >= checkDate); .Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.CreationDate >= checkDate);

View File

@@ -145,10 +145,10 @@ public class CameraController : CameraBaseController
switch (repeatStatus) switch (repeatStatus)
{ {
case "IncomRegistred-InvalidOut": case "IncomRegistred-InvalidOut":
throw new BadRequestException("شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید"); throw new BadRequestException("شما به تازگی ثبت ورود نموده اید ,تا 5 دقیقه نمی توانید ثبت خروج نمایید");
case "outRegistred-InvalidIncom": case "outRegistred-InvalidIncom":
throw new BadRequestException("شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید"); throw new BadRequestException("شما به تازگی ثبت خروج نموده اید تا 5 دقیقه نمی توانید ثبت ورود نمایید");
} }
@@ -201,10 +201,10 @@ public class CameraController : CameraBaseController
switch (repeatStatus) switch (repeatStatus)
{ {
case "IncomRegistred-InvalidOut": case "IncomRegistred-InvalidOut":
throw new BadRequestException("شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید"); throw new BadRequestException("شما به تازگی ثبت ورود نموده اید ,تا 5 دقیقه نمی توانید ثبت خروج نمایید");
case "outRegistred-InvalidIncom": case "outRegistred-InvalidIncom":
throw new BadRequestException("شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید"); throw new BadRequestException("شما به تازگی ثبت خروج نموده اید تا 5 دقیقه نمی توانید ثبت ورود نمایید");
} }
@@ -302,13 +302,13 @@ public class CameraController : CameraBaseController
return new JsonResult(new return new JsonResult(new
{ {
isSuccess = false, isSuccess = false,
message = "شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید", message = "شما به تازگی ثبت ورود نموده اید ,تا 5 دقیقه نمی توانید ثبت خروج نمایید",
}); });
case "outRegistred-InvalidIncom": case "outRegistred-InvalidIncom":
return new JsonResult(new return new JsonResult(new
{ {
isSuccess = false, isSuccess = false,
message = "شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید", message = "شما به تازگی ثبت خروج نموده اید تا 5 دقیقه نمی توانید ثبت ورود نمایید",
}); });
} }
@@ -412,6 +412,32 @@ public class CameraController : CameraBaseController
}); });
} }
} }
[HttpPost("check-password")]
public IActionResult OnPostCheckPassword([FromBody]string password)
{
var cameraAccount = _authHelper.CameraAccountInfo();
var cameraPassword = _cameraAccountApplication.GetDetails(cameraAccount.Id).Password;
(bool Verified, bool NeedUpgrade) result = _passwordHasher.Check(cameraPassword, password);
if (result.Verified)
{
_accountApplication.Logout();
return new JsonResult(new
{
isSuccess = true,
});
}
return new JsonResult(new
{
isSuccess = false,
errorMessage = "گذرواژه اشتباه است",
});
}
} }
public class RollCallExitRequest:RollCallEnterRequest public class RollCallExitRequest:RollCallEnterRequest

View File

@@ -139,13 +139,13 @@ public class IndexModel : PageModel
return new JsonResult(new return new JsonResult(new
{ {
isSuccess = false, isSuccess = false,
message = "شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید", message = "شما به تازگی ثبت ورود نموده اید ,تا 5 دقیقه نمی توانید ثبت خروج نمایید",
}); });
case "outRegistred-InvalidIncom": case "outRegistred-InvalidIncom":
return new JsonResult(new return new JsonResult(new
{ {
isSuccess = false, isSuccess = false,
message = "شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید", message = "شما به تازگی ثبت خروج نموده اید تا 5 دقیقه نمی توانید ثبت ورود نمایید",
}); });
} }

View File

@@ -19,7 +19,7 @@
"sqlDebugging": true, "sqlDebugging": true,
"dotnetRunMessages": "true", "dotnetRunMessages": "true",
"nativeDebugging": true, "nativeDebugging": true,
"applicationUrl": "https://localhost:5004;http://localhost:5003;", "applicationUrl": "https://localhost:5004;http://localhost:5003;https://192.168.0.117:5006",
"jsWebView2Debugging": false, "jsWebView2Debugging": false,
"hotReloadEnabled": true "hotReloadEnabled": true
}, },