com.macro.mall.demo.bo.AdminUserDetails Java Examples
The following examples show how to use
com.macro.mall.demo.bo.AdminUserDetails.
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: SecurityConfig.java From macrozheng with Apache License 2.0 | 6 votes |
@Bean public UserDetailsService userDetailsService() { //获取登录用户信息 return new UserDetailsService() { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { UmsAdminExample example = new UmsAdminExample(); example.createCriteria().andUsernameEqualTo(username); List<UmsAdmin> umsAdminList = umsAdminMapper.selectByExample(example); if (umsAdminList != null && umsAdminList.size() > 0) { return new AdminUserDetails(umsAdminList.get(0)); } throw new UsernameNotFoundException("用户名或密码错误"); } }; }
Example #2
Source File: SecurityConfig.java From mall with Apache License 2.0 | 6 votes |
@Bean public UserDetailsService userDetailsService() { //获取登录用户信息 return new UserDetailsService() { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { UmsAdminExample example = new UmsAdminExample(); example.createCriteria().andUsernameEqualTo(username); List<UmsAdmin> umsAdminList = umsAdminMapper.selectByExample(example); if (umsAdminList != null && umsAdminList.size() > 0) { return new AdminUserDetails(umsAdminList.get(0)); } throw new UsernameNotFoundException("用户名或密码错误"); } }; }
Example #3
Source File: SecurityConfig.java From macrozheng-mall with MIT License | 6 votes |
@Bean public UserDetailsService userDetailsService() { //获取登录用户信息 return new UserDetailsService() { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { UmsAdminExample example = new UmsAdminExample(); example.createCriteria().andUsernameEqualTo(username); List<UmsAdmin> umsAdminList = umsAdminMapper.selectByExample(example); if (umsAdminList != null && umsAdminList.size() > 0) { return new AdminUserDetails(umsAdminList.get(0)); } throw new UsernameNotFoundException("用户名或密码错误"); } }; }