|
|
@@ -20,14 +20,21 @@ public class LoginServiceImpl implements LoginService {
|
|
|
@Override
|
|
|
public ApiResponseCommon<LoginQrCodeResponseData> getLoginQrCodeNewDirect(String authKey, QrCodeRequest request) {
|
|
|
String url = BASE_URL + "/login/GetLoginQrCodeNewDirect?key=" + authKey;
|
|
|
- ApiResponseCommon<LoginQrCodeResponseData> loginQrCodeResponseDataApiResponseCommon = WxWorkHttpUtil.postWithType(
|
|
|
+ ApiResponseCommon<LoginQrCodeResponseData> response = WxWorkHttpUtil.postWithType(
|
|
|
url,
|
|
|
request,
|
|
|
- new TypeReference<ApiResponseCommon<LoginQrCodeResponseData>>() {
|
|
|
- }
|
|
|
+ new TypeReference<ApiResponseCommon<LoginQrCodeResponseData>>() {}
|
|
|
);
|
|
|
- log.info("二维码照片url: {}", loginQrCodeResponseDataApiResponseCommon.getData().getQrCodeUrl());
|
|
|
- return loginQrCodeResponseDataApiResponseCommon;
|
|
|
+
|
|
|
+ //先判断是否成功
|
|
|
+ if (response.getCode() != 200 || response.getData() == null) {
|
|
|
+ String errorMsg = response.getText() != null ? response.getText() : "获取二维码失败";
|
|
|
+ throw new CustomException("获取登录二维码失败: " + errorMsg);
|
|
|
+ }
|
|
|
+
|
|
|
+ //安全访问 data
|
|
|
+ log.info("二维码照片url: {}", response.getData().getQrCodeUrl());
|
|
|
+ return response;
|
|
|
}
|
|
|
|
|
|
@Override
|