|
@@ -2,6 +2,7 @@ package cn.cslg.pas.common.config.InnerInterceptor;
|
|
|
|
|
|
import cn.cslg.pas.common.model.PersonnelVO;
|
|
import cn.cslg.pas.common.model.PersonnelVO;
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
|
|
+import cn.cslg.pas.common.utils.RedisUtil;
|
|
import cn.cslg.pas.common.utils.SecurityUtils.SecurityUtils;
|
|
import cn.cslg.pas.common.utils.SecurityUtils.SecurityUtils;
|
|
import cn.cslg.pas.common.utils.auth.TreeUtils;
|
|
import cn.cslg.pas.common.utils.auth.TreeUtils;
|
|
import cn.cslg.pas.common.model.DataSource;
|
|
import cn.cslg.pas.common.model.DataSource;
|
|
@@ -39,6 +40,10 @@ public class LizzMybatisIntercepts implements InnerInterceptor {
|
|
@Autowired
|
|
@Autowired
|
|
private CacheUtils cacheUtils ;
|
|
private CacheUtils cacheUtils ;
|
|
|
|
|
|
|
|
+ @Lazy//懒加载,当调用时注入
|
|
|
|
+ @Autowired
|
|
|
|
+ private RedisUtil redisUtil ;
|
|
|
|
+
|
|
@Value("${authorUrl}")
|
|
@Value("${authorUrl}")
|
|
private String url;
|
|
private String url;
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@@ -50,6 +55,8 @@ public class LizzMybatisIntercepts implements InnerInterceptor {
|
|
String Localsql = boundSql.getSql();
|
|
String Localsql = boundSql.getSql();
|
|
Map<String,Object> maps= SecurityUtils.getDataScope(); //获得线程里保存的functionId
|
|
Map<String,Object> maps= SecurityUtils.getDataScope(); //获得线程里保存的functionId
|
|
if (maps != null) {
|
|
if (maps != null) {
|
|
|
|
+ String q= "token:login:"+maps.get("token").toString().replace("=",":");
|
|
|
|
+ String a= redisUtil.get(q);
|
|
SecurityUtils.cleanDataScope(); //当第一次进来后删除线程保存的functionId,避免后续使用的查询sql进来
|
|
SecurityUtils.cleanDataScope(); //当第一次进来后删除线程保存的functionId,避免后续使用的查询sql进来
|
|
Integer functionId =Integer.parseInt(maps.get("functionId").toString());
|
|
Integer functionId =Integer.parseInt(maps.get("functionId").toString());
|
|
String token =maps.get("token").toString();
|
|
String token =maps.get("token").toString();
|