@Service public class AccountService extends Object implements org.springframework.security.core.userdetails.UserDetailsService
| 构造器和说明 |
|---|
AccountService() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected org.springframework.security.core.Authentication |
createNewAuthentication(LoginUser user) |
LoginUser |
loadLoginAccount(Long accountId,
IUserType userType)
从数据库加载用户信息
|
LoginUser |
loadLoginAccount(Long accountId,
IUserType userType,
String[] selectProperties)
从数据库加载用户信息
|
LoginUser |
loadUserByUsername(String userInfo) |
LoginUser |
loginByOpenId(String openId)
根据用户openId获取用户详情
|
LoginUser |
loginByOpenId(String openId,
String[] selectProperties) |
LoginUser |
loginByUserId(String userInfo)
根据token中包含的信息获取用户详情
|
LoginUser |
loginByUserId(String userInfo,
String[] selectProperties)
根据token中包含的信息获取用户详情
|
LoginUser |
loginByUsername(String userInfo,
String password,
String loginIp)
根据用户名加载授权认证信息
|
LoginUser |
loginByUsername(String userInfo,
String password,
String[] selectProperties,
String loginIp)
根据用户名加载授权认证信息
|
Admin |
registerAdmin(AdminRegisterForm form,
LoginUser user)
注册worker
|
static String[] |
splitUsernameAndType(String usernameAndType,
UserTypeFactory userTypeFactory) |
public LoginUser loadUserByUsername(String userInfo) throws org.springframework.security.core.userdetails.UsernameNotFoundException
loadUserByUsername 在接口中 org.springframework.security.core.userdetails.UserDetailsServiceorg.springframework.security.core.userdetails.UsernameNotFoundExceptionpublic LoginUser loginByUsername(String userInfo, String password, String loginIp) throws org.springframework.security.core.userdetails.UsernameNotFoundException
userInfo - 用户名@用户类型 watson@admin, watson@worker, watson@userorg.springframework.security.core.userdetails.UsernameNotFoundExceptionpublic LoginUser loginByUsername(String userInfo, String password, String[] selectProperties, String loginIp) throws org.springframework.security.core.userdetails.UsernameNotFoundException
userInfo - 用户名@用户类型 watson@admin, watson@worker, watson@userselectProperties - 登录自定义查询属性,若未定义,则默认使用系统预设值 {"id", "username", "nickName", "gender", "avatarUrl", "mobile", "lastLoginDate", "lastLoginIp", "enabled", "expired", "locked", "credentialsExpired", "extraData"};org.springframework.security.core.userdetails.UsernameNotFoundExceptionprotected org.springframework.security.core.Authentication createNewAuthentication(LoginUser user)
public LoginUser loginByOpenId(String openId) throws org.springframework.security.core.userdetails.UsernameNotFoundException
openId - org.springframework.security.core.userdetails.UsernameNotFoundExceptionpublic LoginUser loginByOpenId(String openId, String[] selectProperties) throws org.springframework.security.core.userdetails.UsernameNotFoundException
org.springframework.security.core.userdetails.UsernameNotFoundExceptionpublic LoginUser loginByUserId(String userInfo) throws org.springframework.security.core.userdetails.UsernameNotFoundException
userInfo - userId@userType, ex. 0@adminorg.springframework.security.core.userdetails.UsernameNotFoundExceptionpublic LoginUser loginByUserId(String userInfo, String[] selectProperties) throws org.springframework.security.core.userdetails.UsernameNotFoundException
userInfo - userId@userType, ex. 0@adminorg.springframework.security.core.userdetails.UsernameNotFoundExceptionpublic LoginUser loadLoginAccount(Long accountId, IUserType userType)
accountId - 账号iduserType - 账号类型,admin/user/workerpublic LoginUser loadLoginAccount(Long accountId, IUserType userType, String[] selectProperties)
accountId - 账号iduserType - 账号类型,admin/user/workerpublic static String[] splitUsernameAndType(String usernameAndType, UserTypeFactory userTypeFactory)
@Transactional public Admin registerAdmin(AdminRegisterForm form, LoginUser user)
Copyright © 2020. All rights reserved.