| | |
| | | package com.ruoyi.common.security.utils; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.constant.TokenConstants; |
| | |
| | | |
| | | /** |
| | | * 权限获取工具类 |
| | | * |
| | | * |
| | | * @author jqs |
| | | */ |
| | | public class SecurityUtils |
| | |
| | | return SecurityContextHolder.get(SecurityConstants.LOGIN_USER, LoginUser.class); |
| | | } |
| | | |
| | | public static SysUser getSysUser() |
| | | { |
| | | return getLoginUser().getSysUser(); |
| | | } |
| | | |
| | | /** |
| | | * 获取请求token |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 是否为管理员 |
| | | * |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 结果 |
| | | */ |