|
@@ -385,8 +385,10 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
|
|
log.info("[authenticate] 用户认证开始, req={}", reqVO.toString());
|
|
log.info("[authenticate] 用户认证开始, req={}", reqVO.toString());
|
|
|
HttpEntity<Void> req = genYiQunAuthHttpEntity(reqVO);
|
|
HttpEntity<Void> req = genYiQunAuthHttpEntity(reqVO);
|
|
|
String appAuthPath = "/external-api/system/auth/app-auth";
|
|
String appAuthPath = "/external-api/system/auth/app-auth";
|
|
|
|
|
+ String fullUrl = baseUrl + appAuthPath;
|
|
|
|
|
+ log.info("[authenticate] 请求蚁群接口开始,fullUrl:{}", fullUrl);
|
|
|
// 使用 token 交换用户信息
|
|
// 使用 token 交换用户信息
|
|
|
- ResponseEntity<String> yiqunResp = restTemplate.exchange(baseUrl + appAuthPath, HttpMethod.GET, req, String.class);
|
|
|
|
|
|
|
+ ResponseEntity<String> yiqunResp = restTemplate.exchange(fullUrl, HttpMethod.GET, req, String.class);
|
|
|
AuthYiqunUserDTO user = null;
|
|
AuthYiqunUserDTO user = null;
|
|
|
if (!yiqunResp.getStatusCode().equals(HttpStatus.OK)) {
|
|
if (!yiqunResp.getStatusCode().equals(HttpStatus.OK)) {
|
|
|
log.warn("[authenticate] APPToken 无效");
|
|
log.warn("[authenticate] APPToken 无效");
|
|
@@ -395,6 +397,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
|
|
|
|
|
|
|
|
|
|
|
|
String json = yiqunResp.getBody();
|
|
String json = yiqunResp.getBody();
|
|
|
|
|
+ log.info("[authenticate] 请求蚁群接口响应,respJSON:{}", json);
|
|
|
try {
|
|
try {
|
|
|
JsonNode jsonNode = objectMapper.readTree(json);
|
|
JsonNode jsonNode = objectMapper.readTree(json);
|
|
|
if (!Objects.equals(jsonNode.get("code").asInt(), 0)) {
|
|
if (!Objects.equals(jsonNode.get("code").asInt(), 0)) {
|
|
@@ -421,6 +424,8 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
+ log.info("获取到的蚁群用户选项:id={}, username={}, deptId={}, employeeNo={}",
|
|
|
|
|
+ user.getId(), user.getUsername(), user.getDeptId(), user.getEmployeeNo());
|
|
|
String username = reqVO.getUsername();
|
|
String username = reqVO.getUsername();
|
|
|
AdminUserDO existedUser = userService.getUserByUsername(username);
|
|
AdminUserDO existedUser = userService.getUserByUsername(username);
|
|
|
if (existedUser == null) {
|
|
if (existedUser == null) {
|