| | |
| | | import com.xcong.excoin.common.exception.GlobalException; |
| | | import com.xcong.excoin.modules.member.entity.MemberEntity; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.HttpRequest; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 登陆用户工具类 |
| | |
| | | return (MemberEntity) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); |
| | | } |
| | | } |
| | | |
| | | public static boolean isBrowser(HttpServletRequest request) { |
| | | String userAgent = request.getHeader("user-agent"); |
| | | if (userAgent.toLowerCase().contains("mobile")) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |