|
@@ -55,10 +55,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
-import org.springframework.http.HttpEntity;
|
|
|
|
|
-import org.springframework.http.HttpHeaders;
|
|
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
|
|
|
|
+import org.springframework.http.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
import org.springframework.web.client.RestTemplate;
|
|
@@ -389,7 +386,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
|
|
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";
|
|
|
// 使用 token 交换用户信息
|
|
// 使用 token 交换用户信息
|
|
|
- ResponseEntity<String> yiqunResp = restTemplate.postForEntity(baseUrl + appAuthPath, req, String.class);
|
|
|
|
|
|
|
+ ResponseEntity<String> yiqunResp = restTemplate.exchange(baseUrl + appAuthPath, 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 无效");
|
|
@@ -418,11 +415,11 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
|
|
throw exception(AUTH_LOGIN_BAD_CREDENTIALS);
|
|
throw exception(AUTH_LOGIN_BAD_CREDENTIALS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (Objects.equals(reqVO.getMode(), "WEB")) {
|
|
|
|
|
- if (!Objects.equals(reqVO.getPassword(), "bowin123")) {
|
|
|
|
|
- throw exception(AUTH_LOGIN_BAD_CREDENTIALS);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (Objects.equals(reqVO.getMode(), "WEB")) {
|
|
|
|
|
+// if (!Objects.equals(reqVO.getPassword(), "bowin123")) {
|
|
|
|
|
+// throw exception(AUTH_LOGIN_BAD_CREDENTIALS);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
String username = reqVO.getUsername();
|
|
String username = reqVO.getUsername();
|
|
|
AdminUserDO existedUser = userService.getUserByUsername(username);
|
|
AdminUserDO existedUser = userService.getUserByUsername(username);
|