获取当前用户信息
基本说明
获取当前登录用户信息
java
/* 以下为SaToken提供的StpUtil的一些方法 */
// 判断当前B端用户是否登录
StpUtil.isLogin()
// 获取当前登录的B端用户的id
StpUtil.getLoginIdAsString()
// 获取当前登录的B端用户的设备类型(PC、APP、MINI)
StpUtil.getLoginDevice()
// 获取当前登录的B端用户的角色列表
StpUtil.getRoleList()
// 获取当前登录的B端用户的权限列表
StpUtil.getPermissionList()
/* 以下为自定义的StpLoginUserUtil的一些方法 */
// 获取当前B端用户对象,获取到对象后可以获取对象的其他各种属性;
StpLoginUserUtil.getLoginUser()
// 获取当前B端登录用户的当前请求接口的数据范围
StpLoginUserUtil.getLoginUserDataScope()