From cbedec7ca68c28d4f85efd0a969be719031da369 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 8 Aug 2022 09:23:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=97=A5=E5=BF=97=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=A7=A3=E9=94=81=E8=B4=A6=E6=88=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitor/SysLogininforController.java | 15 +++++++- ruoyi-ui/src/api/monitor/logininfor.js | 8 +++++ .../src/views/monitor/logininfor/index.vue | 28 ++++++++++++++- sql/{ry_20220712.sql => ry_20220808.sql} | 34 ++++++++++--------- 4 files changed, 67 insertions(+), 18 deletions(-) rename sql/{ry_20220712.sql => ry_20220808.sql} (96%) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java index 5bd40bae..00c6eda9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java @@ -16,6 +16,7 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.service.SysPasswordService; import com.ruoyi.system.domain.SysLogininfor; import com.ruoyi.system.service.ISysLogininforService; @@ -31,6 +32,9 @@ public class SysLogininforController extends BaseController @Autowired private ISysLogininforService logininforService; + @Autowired + private SysPasswordService passwordService; + @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") @GetMapping("/list") public TableDataInfo list(SysLogininfor logininfor) @@ -64,6 +68,15 @@ public class SysLogininforController extends BaseController public AjaxResult clean() { logininforService.cleanLogininfor(); - return AjaxResult.success(); + return success(); + } + + @PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')") + @Log(title = "账户解锁", businessType = BusinessType.OTHER) + @GetMapping("/unlock//{userName}") + public AjaxResult unlock(@PathVariable("userName") String userName) + { + passwordService.clearLoginRecordCache(userName); + return success(); } } diff --git a/ruoyi-ui/src/api/monitor/logininfor.js b/ruoyi-ui/src/api/monitor/logininfor.js index cd781517..c49a40e1 100644 --- a/ruoyi-ui/src/api/monitor/logininfor.js +++ b/ruoyi-ui/src/api/monitor/logininfor.js @@ -17,6 +17,14 @@ export function delLogininfor(infoId) { }) } +// 解锁用户登录状态 +export function unlockLogininfor(userName) { + return request({ + url: '/monitor/logininfor/unlock/' + userName, + method: 'get' + }) +} + // 清空登录日志 export function cleanLogininfor() { return request({ diff --git a/ruoyi-ui/src/views/monitor/logininfor/index.vue b/ruoyi-ui/src/views/monitor/logininfor/index.vue index e9490e79..c7776f52 100644 --- a/ruoyi-ui/src/views/monitor/logininfor/index.vue +++ b/ruoyi-ui/src/views/monitor/logininfor/index.vue @@ -73,6 +73,17 @@ v-hasPermi="['monitor:logininfor:remove']" >清空 + + 解锁 +