From 09bbc605b8c0a0fff95686cc9d0d0660fdee2ebc Mon Sep 17 00:00:00 2001 From: liuhulu Date: Sat, 29 Jun 2019 22:20:01 +0800 Subject: [PATCH] =?UTF-8?q?fix,=E4=B8=BB=E8=A6=81=E9=92=88=E5=AF=B9?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E9=97=AE=E9=A2=98=E8=BF=9B=E8=A1=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E3=80=821.=E5=88=9B=E5=BB=BA=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E4=B8=8D=E4=BF=9D=E5=AD=98=E5=A4=B4=E5=83=8Fbug=E3=80=822?= =?UTF-8?q?=EF=BC=8C=E6=9F=A5=E8=AF=A2=E8=B4=A6=E5=8F=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E6=9F=A5=E8=AF=A2=E5=A4=B4=E5=83=8Fbug?= =?UTF-8?q?=E3=80=823=EF=BC=8C=E9=A6=96=E9=A1=B5=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=B0=B8=E8=BF=9C=E6=98=BE=E7=A4=BA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=A4=B4=E5=83=8Fbug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/framework/shiro/session/OnlineSession.java | 11 +++++++++++ .../shiro/web/filter/online/OnlineSessionFilter.java | 1 + .../main/resources/mapper/system/SysUserMapper.xml | 10 ++++++---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSession.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSession.java index b840d371..09b88c5c 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSession.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSession.java @@ -20,6 +20,9 @@ public class OnlineSession extends SimpleSession /** 部门名称 */ private String deptName; + + /** 用户头像 */ + private String avatar; /** 登录IP地址 */ private String host; @@ -123,6 +126,14 @@ public class OnlineSession extends SimpleSession return attributeChanged; } + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + @Override public void setAttribute(Object key, Object value) { diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/filter/online/OnlineSessionFilter.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/filter/online/OnlineSessionFilter.java index 0924ae7a..070d91e8 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/filter/online/OnlineSessionFilter.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/filter/online/OnlineSessionFilter.java @@ -58,6 +58,7 @@ public class OnlineSessionFilter extends AccessControlFilter { onlineSession.setUserId(user.getUserId()); onlineSession.setLoginName(user.getLoginName()); + onlineSession.setAvatar(user.getAvatar()); onlineSession.setDeptName(user.getDept().getDeptName()); onlineSession.markAttributeChanged(); } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index be2d3814..d60370bd 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select u.user_id, u.dept_id, u.login_name, u.user_name, u.email, u.phonenumber, u.sex, u.avatar, u.password, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.create_time, u.remark, + select u.user_id, u.dept_id, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.avatar, u.password, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.create_time, u.remark, d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u @@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"