com.macro.mall.portal.domain.MemberDetails Java Examples

The following examples show how to use com.macro.mall.portal.domain.MemberDetails. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UmsMemberServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public UmsMember getCurrentMember() {
    SecurityContext ctx = SecurityContextHolder.getContext();
    Authentication auth = ctx.getAuthentication();
    MemberDetails memberDetails = (MemberDetails) auth.getPrincipal();
    return memberDetails.getUmsMember();
}
 
Example #2
Source File: UmsMemberServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public UserDetails loadUserByUsername(String username) {
    UmsMember member = getByUsername(username);
    if(member!=null){
        return new MemberDetails(member);
    }
    throw new UsernameNotFoundException("用户名或密码错误");
}
 
Example #3
Source File: UmsMemberServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public UmsMember getCurrentMember() {
    SecurityContext ctx = SecurityContextHolder.getContext();
    Authentication auth = ctx.getAuthentication();
    MemberDetails memberDetails = (MemberDetails) auth.getPrincipal();
    return memberDetails.getUmsMember();
}
 
Example #4
Source File: SecurityConfig.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Bean
public UserDetailsService userDetailsService() {
    //获取登录用户信息
    return new UserDetailsService() {
        @Override
        public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
            UmsMember member = memberService.getByUsername(username);
            if(member!=null){
                return new MemberDetails(member);
            }
            throw new UsernameNotFoundException("用户名或密码错误");
        }
    };
}
 
Example #5
Source File: UmsMemberServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public UmsMember getCurrentMember() {
    SecurityContext ctx = SecurityContextHolder.getContext();
    Authentication auth = ctx.getAuthentication();
    MemberDetails memberDetails = (MemberDetails) auth.getPrincipal();
    return memberDetails.getUmsMember();
}
 
Example #6
Source File: UmsMemberServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public UserDetails loadUserByUsername(String username) {
    UmsMember member = getByUsername(username);
    if(member!=null){
        return new MemberDetails(member);
    }
    throw new UsernameNotFoundException("用户名或密码错误");
}
 
Example #7
Source File: UmsMemberServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public UmsMember getCurrentMember() {
    SecurityContext ctx = SecurityContextHolder.getContext();
    Authentication auth = ctx.getAuthentication();
    MemberDetails memberDetails = (MemberDetails) auth.getPrincipal();
    return memberDetails.getUmsMember();
}
 
Example #8
Source File: SecurityConfig.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Bean
public UserDetailsService userDetailsService() {
    //获取登录用户信息
    return new UserDetailsService() {
        @Override
        public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
            UmsMember member = memberService.getByUsername(username);
            if(member!=null){
                return new MemberDetails(member);
            }
            throw new UsernameNotFoundException("用户名或密码错误");
        }
    };
}