Commit dc11c6d7 authored by 王亮's avatar 王亮

fix an issue.(jiguang)

parent f3eb584f
...@@ -5,7 +5,6 @@ import cn.quantgroup.xyqb.controller.req.v2.LoginReq; ...@@ -5,7 +5,6 @@ import cn.quantgroup.xyqb.controller.req.v2.LoginReq;
import cn.quantgroup.xyqb.entity.User; import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.exception.BizException; import cn.quantgroup.xyqb.exception.BizException;
import cn.quantgroup.xyqb.exception.BizExceptionEnum; import cn.quantgroup.xyqb.exception.BizExceptionEnum;
import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.model.*; import cn.quantgroup.xyqb.model.*;
import cn.quantgroup.xyqb.model.session.SessionStruct; import cn.quantgroup.xyqb.model.session.SessionStruct;
import cn.quantgroup.xyqb.model.v2.login.BaseLoginParam; import cn.quantgroup.xyqb.model.v2.login.BaseLoginParam;
...@@ -75,7 +74,7 @@ public class SMSDirectJiLoginStrategy implements LoginStrategy { ...@@ -75,7 +74,7 @@ public class SMSDirectJiLoginStrategy implements LoginStrategy {
if (jiGuangResponseParam == null || 8000 != jiGuangResponseParam.getCode()) { if (jiGuangResponseParam == null || 8000 != jiGuangResponseParam.getCode()) {
throw new BizException(BizExceptionEnum.ERROR_DIRECT_LOGIN); throw new BizException(BizExceptionEnum.ERROR_DIRECT_LOGIN);
}else{ } else {
smsLoginParam.setPhone(jiGuangResponseParam.getPhone()); smsLoginParam.setPhone(jiGuangResponseParam.getPhone());
} }
...@@ -86,7 +85,13 @@ public class SMSDirectJiLoginStrategy implements LoginStrategy { ...@@ -86,7 +85,13 @@ public class SMSDirectJiLoginStrategy implements LoginStrategy {
if (user != null && !user.getEnable()) { if (user != null && !user.getEnable()) {
log.info("用户不存在,或者已经注销,phoneNo:{}", smsLoginParam.getPhone()); log.info("用户不存在,或者已经注销,phoneNo:{}", smsLoginParam.getPhone());
throw new BizException(BizExceptionEnum.ERROR_OR_ENABLE_ERROR); throw new BizException(BizExceptionEnum.ERROR_OR_ENABLE_ERROR);
} else {
//用户用户为空,则注册一个新用户
if (user == null) {
user = userRegisterService.register(sessionStruct.getRegisteredFrom(), smsLoginParam.getPhone(), sessionStruct.getTenantId());
}
} }
if (scIsOpen) { if (scIsOpen) {
try { try {
if (!StringUtils.isEmpty(sessionStruct.getScDeviceId())) { if (!StringUtils.isEmpty(sessionStruct.getScDeviceId())) {
...@@ -118,7 +123,7 @@ public class SMSDirectJiLoginStrategy implements LoginStrategy { ...@@ -118,7 +123,7 @@ public class SMSDirectJiLoginStrategy implements LoginStrategy {
LoginProperties loginProperties = new LoginProperties(1, sessionStruct.getRegisteredFrom(), sessionStruct.getTenantId()); LoginProperties loginProperties = new LoginProperties(1, sessionStruct.getRegisteredFrom(), sessionStruct.getTenantId());
AuthBean authBean = sessionService.createSession(user, loginProperties, LoginType.AUTHLOGIN.ordinal(), sessionStruct.getTenantId(),false); AuthBean authBean = sessionService.createSession(user, loginProperties, LoginType.AUTHLOGIN.ordinal(), sessionStruct.getTenantId(), false);
LoginBean loginBean = new LoginBean(); LoginBean loginBean = new LoginBean();
if (authBean != null) { if (authBean != null) {
loginBean.setToken(authBean.getToken()); loginBean.setToken(authBean.getToken());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment