Sfoglia il codice sorgente

免登登录

master
PoffyZhang 1 anno fa
parent
commit
e6a0c3381c
2 ha cambiato i file con 15 aggiunte e 0 eliminazioni
  1. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/constant/LoginTypeEnum.java
  2. +13
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/credential/CredentialAuthProvider.java

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/constant/LoginTypeEnum.java Vedi File

@@ -17,6 +17,8 @@ public enum LoginTypeEnum {
*/
DING_QR_LOGIN,

DING_MD_LOGIN,

/**
* 手机号验证码登陆
*/


+ 13
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/credential/CredentialAuthProvider.java Vedi File

@@ -60,6 +60,19 @@ public class CredentialAuthProvider implements AuthenticationProvider {
user = userDetailsService.loadUserByUsername(accountId + UserDeatilsServiceConstant.USER_DETAILS_SERVICE_SEPARATOR + loginTypeEnum.name());
}
break;
case DING_MD_LOGIN: {
String code = (String) authenticationToken.getCredentials();
GenericResult<String> accountResult = zwddAuthClient.getMobileAccountId(code);
if (!accountResult.isSuccess()) {
throw new BadCredentialsException("login fail! 浙政钉免登校验失败");
}
String accountId = accountResult.getData();
if (Objects.isNull(accountId)) {
throw new BadCredentialsException("login fail! 浙政钉免登校验失败");
}
user = userDetailsService.loadUserByUsername(accountId + UserDeatilsServiceConstant.USER_DETAILS_SERVICE_SEPARATOR + loginTypeEnum.name());
}
break;
case PHONE_VERIFICATION_CODE_LOGIN: {
if (!phoneVerifyCodeSkip) {
// 校验短信验证码


Loading…
Annulla
Salva