1. app登录时用openid查询
This commit is contained in:
		
							parent
							
								
									e41cf73a7b
								
							
						
					
					
						commit
						127dd794d0
					
				|  | @ -252,7 +252,7 @@ public class SysLoginService | |||
|         } | ||||
|         Authentication authentication = null; // 用户验证 | ||||
|         try { | ||||
|             UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(user.getUserName(), Constants.CUSTOM_LOGIN_WX); | ||||
|             UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(user.getWxopenid(), Constants.CUSTOM_LOGIN_WX); | ||||
|             // 用户名和密码等信息保存在一个上下文中,只要是同一线程等会就能拿到用户名和密码,也就是能在loadUserByUsername(String username)方法中进行密码验证等 | ||||
|             AuthenticationContextHolder.setContext(authenticationToken); | ||||
|             // 把用户类型放在上下文中的details属性中,在UserDetailsServiceImpl.loadUserByUsername中获取 | ||||
|  | @ -305,7 +305,7 @@ public class SysLoginService | |||
|         } | ||||
|         Authentication authentication = null; // 用户验证 | ||||
|         try { | ||||
|             UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(user.getUserName(), Constants.CUSTOM_LOGIN_WX); | ||||
|             UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(user.getWxopenid(), Constants.CUSTOM_LOGIN_WX); | ||||
|             // 用户名和密码等信息保存在一个上下文中,只要是同一线程等会就能拿到用户名和密码,也就是能在loadUserByUsername(String username)方法中进行密码验证等 | ||||
|             AuthenticationContextHolder.setContext(authenticationToken); | ||||
|             // 把用户类型放在上下文中的details属性中,在UserDetailsServiceImpl.loadUserByUsername中获取 | ||||
|  |  | |||
|  | @ -74,8 +74,8 @@ public class UserDetailsServiceImpl implements UserDetailsService | |||
| 
 | ||||
|                 return createLoginUser(user); | ||||
|             }else { | ||||
|                 // app用户登录 | ||||
|                 AsUser user = asUserService.selectUserByUserName(username); | ||||
|                 // app用户登录 如果是app用户则用openid查询 | ||||
|                 AsUser user = asUserService.selectUserByWxopenid(username); | ||||
|                 if (StringUtils.isNull(user)) | ||||
|                 { | ||||
|                     log.info("登录用户:{} 不存在.", username); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user