|
@@ -1,6 +1,7 @@
|
|
|
package cn.kdan.pdf.backend.core.service.impl;
|
|
|
|
|
|
import cn.kdan.pdf.backend.core.constant.AuthConstant;
|
|
|
+import cn.kdan.pdf.backend.core.constant.MembersConstant;
|
|
|
import cn.kdan.pdf.backend.core.enums.CaptchaActionEnum;
|
|
|
import cn.kdan.pdf.backend.core.enums.ImageCodeTypeEnum;
|
|
|
import cn.kdan.pdf.backend.core.enums.VerifyTypeEnum;
|
|
@@ -10,11 +11,13 @@ import cn.kdan.pdf.backend.core.model.OauthClientDetailsExample;
|
|
|
import cn.kdan.pdf.backend.core.pojo.oauth2.TokenPOJO;
|
|
|
import cn.kdan.pdf.backend.core.properties.Oauth2LoginProperties;
|
|
|
import cn.kdan.pdf.backend.core.service.AuthService;
|
|
|
+import cn.kdan.pdf.backend.core.service.UserService;
|
|
|
import cn.kdan.pdf.backend.core.utils.TokenUtils;
|
|
|
import constant.CommonConstant;
|
|
|
import exception.BackendRuntimeException;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.http.HttpHeaders;
|
|
|
import org.apache.http.entity.ContentType;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -24,6 +27,7 @@ import org.springframework.stereotype.Service;
|
|
|
import pojo.YunpianSendResult;
|
|
|
import utils.*;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.imageio.ImageIO;
|
|
|
import javax.servlet.ServletOutputStream;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -66,6 +70,9 @@ public class AuthServiceImpl implements AuthService {
|
|
|
@Value("${security.oauth2.client.client-secret:}")
|
|
|
private String secretKey;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
@Override
|
|
|
public OauthClientDetails getById(String clientId) {
|
|
|
return oauthClientDetailsMapper.selectByPrimaryKey(clientId);
|
|
@@ -142,4 +149,13 @@ public class AuthServiceImpl implements AuthService {
|
|
|
return flag;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean checkExist(String account) {
|
|
|
+ if(ObjectUtils.isEmpty(userService.getByAccount(account))){
|
|
|
+ throw new BackendRuntimeException(MembersConstant.EXCEPTION_MSG_USER_NOT_FOUND);
|
|
|
+ }
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
}
|