update 解析ua

This commit is contained in:
Guoqs
2024-06-13 09:26:55 +08:00
parent 7a80a63ce7
commit efc9fd52d6
2 changed files with 7 additions and 2 deletions

View File

@@ -107,7 +107,11 @@
<artifactId>jsowell-thirdparty</artifactId>
</dependency>
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>1.21</version>
</dependency>
</dependencies>
<build>

View File

@@ -21,6 +21,7 @@ import com.jsowell.pile.vo.uniapp.PileConnectorVO;
import com.jsowell.pile.vo.web.ThirdPartySnRelationVO;
import com.jsowell.service.PileService;
import com.jsowell.thirdparty.common.CommonService;
import eu.bitwalker.useragentutils.UserAgent;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -109,7 +110,7 @@ public class JumpController extends BaseController {
@GetMapping("/pile/connectorDetail/{pileConnectorCode}")
public RestApiResponse<?> getConnectorDetail(HttpServletRequest request, @PathVariable("pileConnectorCode") String pileConnectorCode) {
// logger.info("app-xcx-h5查询充电枪口详情 param:{}", pileConnectorCode);
logger.info("User-Agent:{}", request.getHeader("user-agent"));
logger.info("查询充电枪口详情-User-Agent:{}", UserAgent.parseUserAgentString(request.getHeader("user-agent")));
RestApiResponse<?> response = null;
// 截取桩号
String pileSn = StringUtils.substring(pileConnectorCode, 0, 14);