fix(用户管理):新增用户unionId获取逻辑
This commit is contained in:
@@ -36,5 +36,5 @@ public interface ZltUserDetailsService extends UserDetailsService {
|
||||
* 根据微信用户id/openId查询用户
|
||||
* @param wxOpenId 用户id/openId
|
||||
*/
|
||||
UserDetails loadUserByWxOpenId(String wxOpenId,String mobile) throws UsernameNotFoundException;
|
||||
UserDetails loadUserByWxOpenId(String wxOpenId,String mobile,String unionId) throws UsernameNotFoundException;
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ public class UserDetailServiceImpl implements ZltUserDetailsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByWxOpenId(String wxOpenId,String mobile) throws UsernameNotFoundException {
|
||||
SysUser sysUser = userService.findByWxOpenId(wxOpenId,mobile);
|
||||
public UserDetails loadUserByWxOpenId(String wxOpenId,String mobile,String unionId) throws UsernameNotFoundException {
|
||||
SysUser sysUser = userService.findByWxOpenId(wxOpenId,mobile,unionId);
|
||||
checkUser(sysUser);
|
||||
return LoginUserUtils.getLoginAppUser(sysUser);
|
||||
}
|
||||
|
||||
+2
-1
@@ -78,8 +78,9 @@ public class TencentAuthenticationProvider extends BaseAuthenticationProvider {
|
||||
try {
|
||||
String openId = wxLoginResult.get("openid").toString();
|
||||
String sessionKey = wxLoginResult.get("session_key").toString();
|
||||
String unionId = wxLoginResult.get("unionid").toString();
|
||||
String mobile = decryptPhoneNumber(encryptedData,sessionKey,iv);
|
||||
userDetails = userDetailsServiceFactory.getService(authToken).loadUserByWxOpenId(openId,mobile);
|
||||
userDetails = userDetailsServiceFactory.getService(authToken).loadUserByWxOpenId(openId,mobile, unionId);
|
||||
|
||||
} catch (AuthenticationException e) {
|
||||
throw new CustomOAuth2AuthenticationException(e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user