mirror of https://gitee.com/xiaonuobase/snowy
【更新】AuthApi增加校验验证码接口方便其他模块调用
parent
ad80b8508c
commit
eda0205461
|
@ -38,6 +38,14 @@ public interface AuthApi {
|
|||
*/
|
||||
Long getThirdUserCount();
|
||||
|
||||
/**
|
||||
* 校验验证码
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2021/12/28 14:46
|
||||
**/
|
||||
void validValidCode(String phoneOrEmail, String validCode, String validCodeReqNo);
|
||||
|
||||
/**
|
||||
* B端账号密码登录
|
||||
*
|
||||
|
|
|
@ -60,7 +60,7 @@ public class AuthApiProvider implements AuthApi {
|
|||
jsonObject.set("tokenCount", tokenCount);
|
||||
jsonObject.set("createTime", DateTime.of(createTime));
|
||||
return jsonObject;
|
||||
}).collect(Collectors.toList());
|
||||
}).toList();
|
||||
|
||||
List<JSONObject> sessionListC = StpClientUtil.searchSessionId("", -1, -1, true).stream().map(sessionId -> {
|
||||
JSONObject jsonObject = JSONUtil.createObj();
|
||||
|
@ -72,7 +72,7 @@ public class AuthApiProvider implements AuthApi {
|
|||
jsonObject.set("tokenCount", tokenCount);
|
||||
jsonObject.set("createTime", DateTime.of(createTime));
|
||||
return jsonObject;
|
||||
}).collect(Collectors.toList());
|
||||
}).toList();
|
||||
resultObj.set("backUserSessionCount" ,sessionListB.size());
|
||||
resultObj.set("clientUserSessionCount" ,sessionListC.size());
|
||||
return resultObj;
|
||||
|
@ -83,6 +83,11 @@ public class AuthApiProvider implements AuthApi {
|
|||
return authThirdService.count();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validValidCode(String phoneOrEmail, String validCode, String validCodeReqNo) {
|
||||
authService.validValidCode(phoneOrEmail, validCode, validCodeReqNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String doLoginForB(String account, String password, String validCode, String validCodeReqNo) {
|
||||
AuthAccountPasswordLoginParam authAccountPasswordLoginParam = new AuthAccountPasswordLoginParam();
|
||||
|
|
|
@ -112,4 +112,12 @@ public interface AuthService {
|
|||
* @date 2022/7/9 14:44
|
||||
*/
|
||||
void register(AuthRegisterParam authRegisterParam, String type);
|
||||
|
||||
/**
|
||||
* 校验验证码
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2021/12/28 14:46
|
||||
**/
|
||||
void validValidCode(String phoneOrEmail, String validCode, String validCodeReqNo);
|
||||
}
|
||||
|
|
|
@ -317,7 +317,8 @@ public class AuthServiceImpl implements AuthService {
|
|||
* @author xuyuxiang
|
||||
* @date 2022/8/25 15:26
|
||||
**/
|
||||
private void validValidCode(String phoneOrEmail, String validCode, String validCodeReqNo) {
|
||||
@Override
|
||||
public void validValidCode(String phoneOrEmail, String validCode, String validCodeReqNo) {
|
||||
// 依据请求号,取出缓存中的验证码进行校验
|
||||
Object existValidCode;
|
||||
if(ObjectUtil.isEmpty(phoneOrEmail)) {
|
||||
|
|
Loading…
Reference in New Issue