|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.dk.common.util.oauth.AESSecurityUtil;
|
|
import com.dk.common.util.oauth.AESSecurityUtil;
|
|
|
import com.dk.common.util.oauth.JwtUtil;
|
|
import com.dk.common.util.oauth.JwtUtil;
|
|
|
import com.google.common.base.CaseFormat;
|
|
import com.google.common.base.CaseFormat;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.ibatis.builder.StaticSqlSource;
|
|
import org.apache.ibatis.builder.StaticSqlSource;
|
|
|
import org.apache.ibatis.executor.Executor;
|
|
import org.apache.ibatis.executor.Executor;
|
|
|
import org.apache.ibatis.mapping.MappedStatement;
|
|
import org.apache.ibatis.mapping.MappedStatement;
|
|
@@ -39,6 +40,7 @@ import java.util.Map;
|
|
|
* @description 拦截方法添加国际化参数 (目前有点小问题 url拼参数的无法添加)
|
|
* @description 拦截方法添加国际化参数 (目前有点小问题 url拼参数的无法添加)
|
|
|
* TODO selectById的非Map类型参数的暂不支持 待修改
|
|
* TODO selectById的非Map类型参数的暂不支持 待修改
|
|
|
*/
|
|
*/
|
|
|
|
|
+@Slf4j
|
|
|
@Component
|
|
@Component
|
|
|
@Intercepts({
|
|
@Intercepts({
|
|
|
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class,
|
|
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class,
|
|
@@ -58,6 +60,10 @@ public class MybatisSqlIntercept implements Interceptor {
|
|
|
public Object intercept(Invocation invocation) throws Throwable {
|
|
public Object intercept(Invocation invocation) throws Throwable {
|
|
|
|
|
|
|
|
Integer cpId = 0;
|
|
Integer cpId = 0;
|
|
|
|
|
+ if(httpServletRequest==null){
|
|
|
|
|
+ log.info("mybatis查询拦截器=>请求头为空");
|
|
|
|
|
+ return new Invocation(invocation.getTarget(), invocation.getMethod(), invocation.getArgs()).proceed();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
String authorization = httpServletRequest.getHeader("Authorization");
|
|
String authorization = httpServletRequest.getHeader("Authorization");
|
|
|
|
|
|