mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-26 19:51:56 +08:00
Compare commits
3 Commits
f36e5abea6
...
4e80e4fd30
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e80e4fd30 | ||
|
|
8c096cba8d | ||
|
|
bba81bafda |
@@ -8,6 +8,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
import com.ruoyi.common.core.annotation.Excel.ColumnType;
|
import com.ruoyi.common.core.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.common.core.annotation.Excel.Type;
|
import com.ruoyi.common.core.annotation.Excel.Type;
|
||||||
|
import com.ruoyi.common.core.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.annotation.Excels;
|
import com.ruoyi.common.core.annotation.Excels;
|
||||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
import com.ruoyi.common.core.xss.Xss;
|
import com.ruoyi.common.core.xss.Xss;
|
||||||
@@ -116,7 +117,7 @@ public class SysUser extends BaseEntity
|
|||||||
|
|
||||||
public static boolean isAdmin(Long userId)
|
public static boolean isAdmin(Long userId)
|
||||||
{
|
{
|
||||||
return userId != null && 1L == userId;
|
return UserConstants.isAdmin(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getDeptId()
|
public Long getDeptId()
|
||||||
|
|||||||
@@ -80,4 +80,9 @@ public class UserConstants
|
|||||||
public static final int PASSWORD_MIN_LENGTH = 5;
|
public static final int PASSWORD_MIN_LENGTH = 5;
|
||||||
|
|
||||||
public static final int PASSWORD_MAX_LENGTH = 20;
|
public static final int PASSWORD_MAX_LENGTH = 20;
|
||||||
|
|
||||||
|
public static boolean isAdmin(Long userId)
|
||||||
|
{
|
||||||
|
return userId != null && 1L == userId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- RuoYi Common Security -->
|
<!-- RuoYi Common Core -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-security</artifactId>
|
<artifactId>ruoyi-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import com.fasterxml.jackson.databind.JsonMappingException;
|
|||||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
|
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
|
||||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
import com.ruoyi.common.core.constant.UserConstants;
|
||||||
|
import com.ruoyi.common.core.context.SecurityContextHolder;
|
||||||
import com.ruoyi.common.sensitive.annotation.Sensitive;
|
import com.ruoyi.common.sensitive.annotation.Sensitive;
|
||||||
import com.ruoyi.common.sensitive.enums.DesensitizedType;
|
import com.ruoyi.common.sensitive.enums.DesensitizedType;
|
||||||
import com.ruoyi.system.api.model.LoginUser;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据脱敏序列化过滤
|
* 数据脱敏序列化过滤
|
||||||
@@ -55,9 +55,9 @@ public class SensitiveJsonSerializer extends JsonSerializer<String> implements C
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
LoginUser securityUser = SecurityUtils.getLoginUser();
|
Long userId = SecurityContextHolder.getUserId();
|
||||||
// 管理员不脱敏
|
// 管理员不脱敏
|
||||||
return !securityUser.getSysUser().isAdmin();
|
return !UserConstants.isAdmin(userId);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ create table QRTZ_TRIGGERS (
|
|||||||
misfire_instr smallint(2) null comment '补偿执行的策略',
|
misfire_instr smallint(2) null comment '补偿执行的策略',
|
||||||
job_data blob null comment '存放持久化job对象',
|
job_data blob null comment '存放持久化job对象',
|
||||||
primary key (sched_name, trigger_name, trigger_group),
|
primary key (sched_name, trigger_name, trigger_group),
|
||||||
foreign key (sched_name, job_name, job_group) references QRTZ_JOB_DETAILS(sched_name, job_name, job_group)
|
constraint tr_jb foreign key (sched_name, job_name, job_group) references QRTZ_JOB_DETAILS(sched_name, job_name, job_group)
|
||||||
) engine=innodb comment = '触发器详细信息表';
|
) engine=innodb comment = '触发器详细信息表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -62,7 +62,7 @@ create table QRTZ_SIMPLE_TRIGGERS (
|
|||||||
repeat_interval bigint(12) not null comment '重复的间隔时间',
|
repeat_interval bigint(12) not null comment '重复的间隔时间',
|
||||||
times_triggered bigint(10) not null comment '已经触发的次数',
|
times_triggered bigint(10) not null comment '已经触发的次数',
|
||||||
primary key (sched_name, trigger_name, trigger_group),
|
primary key (sched_name, trigger_name, trigger_group),
|
||||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
constraint st_tr foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||||
) engine=innodb comment = '简单触发器的信息表';
|
) engine=innodb comment = '简单触发器的信息表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -75,7 +75,7 @@ create table QRTZ_CRON_TRIGGERS (
|
|||||||
cron_expression varchar(200) not null comment 'cron表达式',
|
cron_expression varchar(200) not null comment 'cron表达式',
|
||||||
time_zone_id varchar(80) comment '时区',
|
time_zone_id varchar(80) comment '时区',
|
||||||
primary key (sched_name, trigger_name, trigger_group),
|
primary key (sched_name, trigger_name, trigger_group),
|
||||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
constraint ct_tr foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||||
) engine=innodb comment = 'Cron类型的触发器表';
|
) engine=innodb comment = 'Cron类型的触发器表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -87,7 +87,7 @@ create table QRTZ_BLOB_TRIGGERS (
|
|||||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||||
blob_data blob null comment '存放持久化Trigger对象',
|
blob_data blob null comment '存放持久化Trigger对象',
|
||||||
primary key (sched_name, trigger_name, trigger_group),
|
primary key (sched_name, trigger_name, trigger_group),
|
||||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
constraint bt_tr foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||||
) engine=innodb comment = 'Blob类型的触发器表';
|
) engine=innodb comment = 'Blob类型的触发器表';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@@ -168,7 +168,7 @@ create table QRTZ_SIMPROP_TRIGGERS (
|
|||||||
bool_prop_1 varchar(1) null comment 'Boolean类型的trigger的第一个参数',
|
bool_prop_1 varchar(1) null comment 'Boolean类型的trigger的第一个参数',
|
||||||
bool_prop_2 varchar(1) null comment 'Boolean类型的trigger的第二个参数',
|
bool_prop_2 varchar(1) null comment 'Boolean类型的trigger的第二个参数',
|
||||||
primary key (sched_name, trigger_name, trigger_group),
|
primary key (sched_name, trigger_name, trigger_group),
|
||||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
constraint sp_tr foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||||
) engine=innodb comment = '同步机制的行锁表';
|
) engine=innodb comment = '同步机制的行锁表';
|
||||||
|
|
||||||
commit;
|
commit;
|
||||||
Reference in New Issue
Block a user