提交 e93b2ba9 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码 [ibz-disk,存储]

上级 7ce04f0b
...@@ -11,6 +11,7 @@ import org.apache.ibatis.mapping.VendorDatabaseIdProvider; ...@@ -11,6 +11,7 @@ import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Properties; import java.util.Properties;
/** /**
...@@ -19,7 +20,6 @@ import java.util.Properties; ...@@ -19,7 +20,6 @@ import java.util.Properties;
@Configuration @Configuration
@MapperScan(value="cn.ibizlab.core.*.mapper",nameGenerator = UniqueNameGenerator.class) @MapperScan(value="cn.ibizlab.core.*.mapper",nameGenerator = UniqueNameGenerator.class)
public class MybatisConfiguration { public class MybatisConfiguration {
/** /**
* mybatis适配多数据库 * mybatis适配多数据库
* @return * @return
...@@ -53,5 +53,6 @@ public class MybatisConfiguration { ...@@ -53,5 +53,6 @@ public class MybatisConfiguration {
paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true)); paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
return paginationInterceptor; return paginationInterceptor;
} }
} }
\ No newline at end of file
...@@ -49,6 +49,14 @@ public class AuthenticationUser implements UserDetails ...@@ -49,6 +49,14 @@ public class AuthenticationUser implements UserDetails
*/ */
private String domain; private String domain;
/** /**
* 租户
*/
private String srfdcid;
/**
* 动态实例标识
*/
private String srfdynainstid;
/**
* 部门标识 * 部门标识
*/ */
private String mdeptid; private String mdeptid;
......
...@@ -3,6 +3,7 @@ package cn.ibizlab.util.security; ...@@ -3,6 +3,7 @@ package cn.ibizlab.util.security;
import io.jsonwebtoken.ExpiredJwtException; import io.jsonwebtoken.ExpiredJwtException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.util.service.AuthenticationUserService; import cn.ibizlab.util.service.AuthenticationUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
...@@ -26,7 +27,7 @@ import java.util.*; ...@@ -26,7 +27,7 @@ import java.util.*;
@Component @Component
public class AuthorizationTokenFilter extends OncePerRequestFilter { public class AuthorizationTokenFilter extends OncePerRequestFilter {
private final UserDetailsService userDetailsService; private final AuthenticationUserService userDetailsService;
private final AuthTokenUtil authTokenUtil; private final AuthTokenUtil authTokenUtil;
private final String tokenHeader; private final String tokenHeader;
private Set<String> excludesPattern = new HashSet<String>(); private Set<String> excludesPattern = new HashSet<String>();
...@@ -60,7 +61,6 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter { ...@@ -60,7 +61,6 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) { if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
UserDetails userDetails = this.userDetailsService.loadUserByUsername(username); UserDetails userDetails = this.userDetailsService.loadUserByUsername(username);
if (authTokenUtil.validateToken(authToken, userDetails)) { if (authTokenUtil.validateToken(authToken, userDetails)) {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities()); UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
......
...@@ -16,11 +16,16 @@ public interface AuthenticationUserService extends UserDetailsService { ...@@ -16,11 +16,16 @@ public interface AuthenticationUserService extends UserDetailsService {
@Override @Override
@Cacheable( value="ibzuaa_users", key = "'getByUsername:'+#p0") @Cacheable( value="ibzuaa_users", key = "'getByUsername:'+#p0")
AuthenticationUser loadUserByUsername(String username); default AuthenticationUser loadUserByUsername(String username){
return null ;
}
@Cacheable( value="ibzuaa_users", key = "'getByUsername:'+#p0") @Cacheable( value="ibzuaa_users", key = "'getByUsername:'+#p0")
AuthenticationUser loadUserByLogin(String username,String password); AuthenticationUser loadUserByLogin(String username,String password);
@CacheEvict( value="ibzuaa_users", key = "'getByUsername:'+#p0") @CacheEvict( value="ibzuaa_users", key = "'getByUsername:'+#p0")
void resetByUsername(String username); default void resetByUsername(String username){}
} }
...@@ -54,10 +54,4 @@ public class IBZUAAUserService implements AuthenticationUserService{ ...@@ -54,10 +54,4 @@ public class IBZUAAUserService implements AuthenticationUserService{
return user; return user;
} }
@Override
public void resetByUsername(String username) {
}
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册