提交 8dbf0751 编写于 作者: pengcheng.zhou's avatar pengcheng.zhou

一键登录日志入库完善

上级 b63706fe
流水线 #33499 已失败 于阶段
in 3 second
......@@ -99,7 +99,7 @@ public class LoginV1ServiceImpl implements LoginV1Service {
public LoginResult oneClickLoginV1(OneClickLoginReq req) {
QueryMobileEntity queryMobileEntity = oneClickProcessor.tokenExchangeMobile(req.getToken(), req.getSourceType());
if (queryMobileEntity == null || StringUtils.isBlank(queryMobileEntity.getMobile()) || !ValidateUtils.isMobile(queryMobileEntity.getMobile())) {
logger.error("oneClickLogin 闪验获取出错-queryMobileEntity:{}", JSONObject.toJSONString(queryMobileEntity));
logger.error("oneClickLoginV1 闪验获取出错-queryMobileEntity:{}", JSONObject.toJSONString(queryMobileEntity));
throw new PicaException(PicaResultCode.INTERFACE_INVOKE_EXCEPTION.code(), "获取手机号失败!");
}
......@@ -133,7 +133,12 @@ public class LoginV1ServiceImpl implements LoginV1Service {
result = processLoginV1(baseRequest, accountInfoEntity.getId(), AccountTypeEnum.LOGIN_ONE_CLICK.getCode(), queryMobileEntity);
// 记录继续一键登录日志
poolTaskExecutor.execute(() -> insertLog(userId, queryMobileEntity.getMobile(), deviceToken));
JSONObject param = new JSONObject();
param.put("req", JSONObject.toJSONString(req));
param.put("queryMobileEntity", JSONObject.toJSONString(queryMobileEntity));
param.put("accountInfoEntity", JSONObject.toJSONString(accountInfoEntity));
param.put("baseRequest", JSONObject.toJSONString(baseRequest));
poolTaskExecutor.execute(() -> insertLog(userId, queryMobileEntity.getMobile(), deviceToken, param.toJSONString()));
} else {
// 第一次点"一键登录"接口,需要比对上次登录的手机号与这次是否一样
if (userId == null) {
......@@ -171,7 +176,7 @@ public class LoginV1ServiceImpl implements LoginV1Service {
return result;
}
private void insertLog(Integer userId, String currMobilePhone, String deviceToken) {
private void insertLog(Integer userId, String currMobilePhone, String deviceToken, String keepBack) {
// 获取上一次登录的手机号
String lastMobilePhone = "";
PICAPDoctor doctor = doctorInfoMapper.queryDoctor(userId);
......@@ -192,7 +197,7 @@ public class LoginV1ServiceImpl implements LoginV1Service {
logOneChlickCheck.setDeleteFlag((byte) 1);
logOneChlickCheck.setUsedShanyan(true);
logOneChlickCheck.setDeviceToken(deviceToken);
logOneChlickCheck.setKeepBack("");
logOneChlickCheck.setKeepBack(keepBack);
logOneChlickCheckMapper.insertOne(logOneChlickCheck);
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册