Commit 67767e28 authored by 唐峰's avatar 唐峰

Merge branch 'feature-migration-20230628' of...

Merge branch 'feature-migration-20230628' of git.quantgroup.cn:head_group/xyqb-user2 into feature-migration-20230628
parents 8f9a01c2 e431f5d7
...@@ -90,16 +90,6 @@ public class LoginContext { ...@@ -90,16 +90,6 @@ public class LoginContext {
if (loginBean.getUserId() != null) { if (loginBean.getUserId() != null) {
User user = userRepository.findByIdAndTenantId(loginBean.getUserId(), loginBean.getTenantId()); User user = userRepository.findByIdAndTenantId(loginBean.getUserId(), loginBean.getTenantId());
if (StringUtils.isEmpty(loginBean.getOpenId())) {
List<WechatUserInfo> wechatUserInfos = wechatService.queryListByUserId(user.getId(), user.getTenantId());
if (CollectionUtils.isNotEmpty(wechatUserInfos)) {
wechatUserInfos.stream().filter(i -> sessionStruct.getRegisteredFrom().equals(i.getRegisteredFrom())).forEach(i -> {
loginBean.setOpenId(i.getOpenId());
loginBean.setUnionId(i.getUnionId());
});
}
}
if (loginReq.isAttachInfo()) { if (loginReq.isAttachInfo()) {
UserInfoEntity userInfoEntity = userInfoRepository.findByUserIdAndTenantId(loginBean.getUserId(), loginBean.getTenantId()); UserInfoEntity userInfoEntity = userInfoRepository.findByUserIdAndTenantId(loginBean.getUserId(), loginBean.getTenantId());
loginBean.setInfo(new UserInfo(user, userInfoEntity)); loginBean.setInfo(new UserInfo(user, userInfoEntity));
......
...@@ -148,6 +148,8 @@ public class WechatMiniPhoneLoginStrategy implements LoginStrategy { ...@@ -148,6 +148,8 @@ public class WechatMiniPhoneLoginStrategy 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.WECHATLOGIN.ordinal(), sessionStruct.getTenantId(),false); AuthBean authBean = sessionService.createSession(user, loginProperties, LoginType.WECHATLOGIN.ordinal(), sessionStruct.getTenantId(),false);
LoginBean loginBean = new LoginBean(); LoginBean loginBean = new LoginBean();
loginBean.setOpenId(openid);
loginBean.setUnionId(unionId);
if (authBean != null) { if (authBean != null) {
loginBean.setToken(authBean.getToken()); loginBean.setToken(authBean.getToken());
loginBean.setPhoneNo(authBean.getPhoneNo()); loginBean.setPhoneNo(authBean.getPhoneNo());
......
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