(新增)[后端](增加登录验证码校验)

This commit is contained in:
laker
2021-08-17 11:10:18 +08:00
parent 130a9535b4
commit f4aa42aa10
23 changed files with 183 additions and 60 deletions

View File

@@ -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) {