mirror of
https://gitee.com/lakernote/easy-admin.git
synced 2026-09-06 06:57:18 +08:00
(新增)[后端](增加登录验证码校验)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package com.laker.admin.utils.http;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.useragent.UserAgent;
|
||||
import cn.hutool.http.useragent.UserAgentUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StreamUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -46,6 +49,18 @@ public class HttpServletRequestUtil {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取getRequestURI
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getRequestUserAgent() {
|
||||
HttpServletRequest request = getRequest();
|
||||
UserAgent userAgent = UserAgentUtil.parse(request.getHeader("User-Agent"));
|
||||
return JSONUtil.toJsonStr(userAgent);
|
||||
|
||||
}
|
||||
|
||||
public static String getRemoteAddress() {
|
||||
HttpServletRequest request = getRequest();
|
||||
if (request == null) {
|
||||
|
||||
Reference in New Issue
Block a user