|
@@ -70,19 +70,14 @@ public class QwLoginController {
|
|
|
@PostMapping("/automaticLogin")
|
|
|
public CommonResponse<String> automaticLogin(@RequestBody Map<String, String> request) {
|
|
|
String uuid = request.get("uuid");
|
|
|
- String url = qywxConfig.getDomain() + qywxConfig.getPath("auto-login");
|
|
|
- Map<String, Object> requestBody = new HashMap<>();
|
|
|
- requestBody.put("uuid", uuid);
|
|
|
- Optional<String> response = httpPoolClientDefault.postJson(url, JSON.toJSONString(requestBody));
|
|
|
- if (response.isPresent()) {
|
|
|
- QwCommonResModel<Object> model = QwCommonResModel.parseResponse(response.get(),Object.class);
|
|
|
- if (model.getErrcode() == 0) {
|
|
|
- return CommonResponse.success();
|
|
|
- } else {
|
|
|
- return CommonResponse.error("failed");
|
|
|
- }
|
|
|
+ boolean success = qwLoginService.automatedLogin(uuid);
|
|
|
+ if (!success) {
|
|
|
+ LOGGER.error("automaticLogin failed, uuid: {}", uuid);
|
|
|
+ return CommonResponse.error("failed");
|
|
|
+ } else {
|
|
|
+ LOGGER.info("automaticLogin success, uuid: {}", uuid);
|
|
|
+ return CommonResponse.success("success");
|
|
|
}
|
|
|
- return CommonResponse.error("failed");
|
|
|
}
|
|
|
|
|
|
@PostMapping("/quiteQwLogin")
|