增加获取用户日志
This commit is contained in:
parent
921fc6d7fb
commit
a342994b3f
@ -14,6 +14,7 @@ import com.lz.modules.sys.entity.SysUserEntity;
|
||||
import com.lz.modules.sys.entity.SysUserEntityDto;
|
||||
import com.lz.modules.sys.entity.SysUserTokenEntity;
|
||||
import com.lz.modules.sys.service.ShiroService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authc.*;
|
||||
import org.apache.shiro.authz.AuthorizationInfo;
|
||||
import org.apache.shiro.authz.SimpleAuthorizationInfo;
|
||||
@ -30,6 +31,7 @@ import java.util.Set;
|
||||
* @author Mark sunlightcs@gmail.com
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class OAuth2Realm extends AuthorizingRealm {
|
||||
@Autowired
|
||||
private ShiroService shiroService;
|
||||
@ -74,8 +76,10 @@ public class OAuth2Realm extends AuthorizingRealm {
|
||||
SysUserEntity user = null;
|
||||
StaffEntity staffEntity = staffService.selectStaffById(tokenEntity.getUserId());
|
||||
if(tokenEntity.getType() == 0){ //如果是系统用户
|
||||
log.info("token判定为系统用户");
|
||||
user = shiroService.queryUser(tokenEntity.getUserId());
|
||||
if(staffEntity != null){
|
||||
log.info("查询到系统用户信息");
|
||||
user.setAvatar(staffEntity.getAvatar());
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user