From 1d3a277b4284f549a889141de018dbea25d1b215 Mon Sep 17 00:00:00 2001 From: "zhiyong.ning" <354350178@qq.com> Date: Wed, 17 Mar 2021 10:43:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yipin/liuwanr/entity/UserInfo.java | 2 ++ src/main/java/com/yipin/liuwanr/service/UserInfoService.java | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/entity/UserInfo.java b/src/main/java/com/yipin/liuwanr/entity/UserInfo.java index f56be07..6949a8c 100644 --- a/src/main/java/com/yipin/liuwanr/entity/UserInfo.java +++ b/src/main/java/com/yipin/liuwanr/entity/UserInfo.java @@ -99,4 +99,6 @@ public class UserInfo { private String twoDepartmentName; //组织架构id private Integer organizationRelationshipId; + //登陆时间 + private String dataTime; } diff --git a/src/main/java/com/yipin/liuwanr/service/UserInfoService.java b/src/main/java/com/yipin/liuwanr/service/UserInfoService.java index 21bc901..214c5b9 100644 --- a/src/main/java/com/yipin/liuwanr/service/UserInfoService.java +++ b/src/main/java/com/yipin/liuwanr/service/UserInfoService.java @@ -440,12 +440,13 @@ public class UserInfoService { String roleId = userInfo.getRoleId(); Integer schoolId = userInfo.getSchoolId(); try { + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 + String date = df.format(new Date());// new Date()为获取当前系统时间,也可使用当前时间戳 UserInfo user=userInfoMapper.logins(userInfo); String token = user.getToken(); Integer userId = user.getUserId(); + user.setDataTime(date); obj.put("user",user); - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 - String date = df.format(new Date());// new Date()为获取当前系统时间,也可使用当前时间戳 if(id!=null) { List staffList = userInfoMapper.queryStaffAll(id,roleId,schoolId); obj.put("staffList",staffList);