mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-31 17:15:29 +08:00
2.1.3 大屏版本发布
This commit is contained in:
@ -66,6 +66,10 @@ public class ShiroConfig {
|
||||
filterChainDefinitionMap.put(url,"anon");
|
||||
}
|
||||
}
|
||||
//大屏请求排除
|
||||
filterChainDefinitionMap.put("/big/screen/**", "anon");
|
||||
filterChainDefinitionMap.put("/bigscreen/**", "anon");
|
||||
|
||||
//cas验证登录
|
||||
filterChainDefinitionMap.put("/cas/client/validateLogin", "anon");
|
||||
// 配置不会被拦截的链接 顺序判断
|
||||
@ -119,7 +123,7 @@ public class ShiroConfig {
|
||||
|
||||
//排除Online请求
|
||||
filterChainDefinitionMap.put("/auto/cgform/**", "anon");
|
||||
|
||||
|
||||
//websocket排除
|
||||
filterChainDefinitionMap.put("/websocket/**", "anon");
|
||||
|
||||
|
||||
@ -45,32 +45,20 @@ public class MybatisInterceptor implements Interceptor {
|
||||
return invocation.proceed();
|
||||
}
|
||||
if (SqlCommandType.INSERT == sqlCommandType) {
|
||||
LoginUser sysUser = this.getLoginUser();
|
||||
Field[] fields = oConvertUtils.getAllFields(parameter);
|
||||
for (Field field : fields) {
|
||||
log.debug("------field.name------" + field.getName());
|
||||
try {
|
||||
//update-begin--Author:scott Date:20190828 for:关于使用Quzrtz 开启线程任务, #465
|
||||
// 获取登录用户信息
|
||||
LoginUser sysUser = null;
|
||||
try{
|
||||
sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
}catch (Exception e){
|
||||
sysUser = null;
|
||||
}
|
||||
//update-end--Author:scott Date:20190828 for:关于使用Quzrtz 开启线程任务, #465
|
||||
if ("createBy".equals(field.getName())) {
|
||||
field.setAccessible(true);
|
||||
Object local_createBy = field.get(parameter);
|
||||
field.setAccessible(false);
|
||||
if (local_createBy == null || local_createBy.equals("")) {
|
||||
String createBy = "jeecg";
|
||||
if (sysUser != null) {
|
||||
// 登录账号
|
||||
createBy = sysUser.getUsername();
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(createBy)) {
|
||||
// 登录人账号
|
||||
field.setAccessible(true);
|
||||
field.set(parameter, createBy);
|
||||
field.set(parameter, sysUser.getUsername());
|
||||
field.setAccessible(false);
|
||||
}
|
||||
}
|
||||
@ -92,15 +80,10 @@ public class MybatisInterceptor implements Interceptor {
|
||||
Object local_sysOrgCode = field.get(parameter);
|
||||
field.setAccessible(false);
|
||||
if (local_sysOrgCode == null || local_sysOrgCode.equals("")) {
|
||||
String sysOrgCode = "";
|
||||
// 获取登录用户信息
|
||||
if (sysUser != null) {
|
||||
// 登录账号
|
||||
sysOrgCode = sysUser.getOrgCode();
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(sysOrgCode)) {
|
||||
field.setAccessible(true);
|
||||
field.set(parameter, sysOrgCode);
|
||||
field.set(parameter, sysUser.getOrgCode());
|
||||
field.setAccessible(false);
|
||||
}
|
||||
}
|
||||
@ -110,6 +93,7 @@ public class MybatisInterceptor implements Interceptor {
|
||||
}
|
||||
}
|
||||
if (SqlCommandType.UPDATE == sqlCommandType) {
|
||||
LoginUser sysUser = this.getLoginUser();
|
||||
Field[] fields = null;
|
||||
if (parameter instanceof ParamMap) {
|
||||
ParamMap<?> p = (ParamMap<?>) parameter;
|
||||
@ -137,12 +121,10 @@ public class MybatisInterceptor implements Interceptor {
|
||||
try {
|
||||
if ("updateBy".equals(field.getName())) {
|
||||
//获取登录用户信息
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if (sysUser != null) {
|
||||
// 登录账号
|
||||
String updateBy = sysUser.getUsername();
|
||||
field.setAccessible(true);
|
||||
field.set(parameter, updateBy);
|
||||
field.set(parameter, sysUser.getUsername());
|
||||
field.setAccessible(false);
|
||||
}
|
||||
}
|
||||
@ -169,4 +151,17 @@ public class MybatisInterceptor implements Interceptor {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
//update-begin--Author:scott Date:20191213 for:关于使用Quzrtz 开启线程任务, #465
|
||||
private LoginUser getLoginUser() {
|
||||
LoginUser sysUser = null;
|
||||
try {
|
||||
sysUser = SecurityUtils.getSubject().getPrincipal() != null ? (LoginUser) SecurityUtils.getSubject().getPrincipal() : null;
|
||||
} catch (Exception e) {
|
||||
//e.printStackTrace();
|
||||
sysUser = null;
|
||||
}
|
||||
return sysUser;
|
||||
}
|
||||
//update-end--Author:scott Date:20191213 for:关于使用Quzrtz 开启线程任务, #465
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user