Ver Fonte

去除日志系统的开发

dongxin há 1 ano atrás
pai
commit
49b2d48998

+ 0 - 48
commons/src/main/java/com/jzg/commons/annotation/Log.java

@@ -1,48 +0,0 @@
-package com.jzg.commons.annotation;
-
-import com.jzg.commons.entity.enums.BusinessType;
-import com.jzg.commons.entity.enums.OperatorType;
-
-import java.lang.annotation.*;
-
-/**
- * 自定义操作日志记录注解
- * 
- * @author dongxin
- *
- */
-@Target({ ElementType.PARAMETER, ElementType.METHOD })
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log
-{
-    /**
-     * 模块
-     */
-    public String title() default "";
-
-    /**
-     * 功能
-     */
-    public BusinessType businessType() default BusinessType.OTHER;
-
-    /**
-     * 操作人类别
-     */
-    public OperatorType operatorType() default OperatorType.MANAGE;
-
-    /**
-     * 是否保存请求的参数
-     */
-    public boolean isSaveRequestData() default true;
-
-    /**
-     * 是否保存响应的参数
-     */
-    public boolean isSaveResponseData() default true;
-
-    /**
-     * 排除指定的请求参数
-     */
-    public String[] excludeParamNames() default {};
-}

+ 0 - 64
commons/src/main/java/com/jzg/commons/config/ThreadPoolConfig.java

@@ -1,64 +0,0 @@
-package com.jzg.commons.config;
-
-import com.jzg.commons.util.Threads;
-import org.apache.commons.lang3.concurrent.BasicThreadFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadPoolExecutor;
-
-/**
- * 线程池配置
- *
- * @author dongxin
- **/
-@Configuration
-public class ThreadPoolConfig
-{
-    // 核心线程池大小
-    private int corePoolSize = 50;
-
-    // 最大可创建的线程数
-    private int maxPoolSize = 200;
-
-    // 队列最大长度
-    private int queueCapacity = 1000;
-
-    // 线程池维护线程所允许的空闲时间
-    private int keepAliveSeconds = 300;
-
-    @Bean(name = "threadPoolTaskExecutor")
-    public ThreadPoolTaskExecutor threadPoolTaskExecutor()
-    {
-        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
-        executor.setMaxPoolSize(maxPoolSize);
-        executor.setCorePoolSize(corePoolSize);
-        executor.setQueueCapacity(queueCapacity);
-        executor.setKeepAliveSeconds(keepAliveSeconds);
-        // 线程池对拒绝任务(无线程可用)的处理策略
-        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
-        return executor;
-    }
-
-    /**
-     * 执行周期性或定时任务
-     */
-    @Bean(name = "scheduledExecutorService")
-    protected ScheduledExecutorService scheduledExecutorService()
-    {
-        return new ScheduledThreadPoolExecutor(corePoolSize,
-                new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build(),
-                new ThreadPoolExecutor.CallerRunsPolicy())
-        {
-            @Override
-            protected void afterExecute(Runnable r, Throwable t)
-            {
-                super.afterExecute(r, t);
-                Threads.printException(r, t);
-            }
-        };
-    }
-}

+ 4 - 4
commons/src/main/java/com/jzg/commons/entity/dto/SysUserAddParam.java

@@ -21,10 +21,10 @@ public class SysUserAddParam {
     private String username;
 
     /** 密码 */
-    @Size(min=8,max=20,message = "密码长度不能大于20,不能小于8")
-    @Schema(description = "密码")
-    @NotNull(message = "登录密码不能为空")
-    private String password;
+//    @Size(min=8,max=20,message = "密码长度不能大于20,不能小于8")
+//    @Schema(description = "密码")
+//    @NotNull(message = "登录密码不能为空")
+//    private String password;
 
     /** 手机号 */
     @Schema(description = "手机号")

+ 4 - 4
commons/src/main/java/com/jzg/commons/entity/dto/SysUserEditParam.java

@@ -25,10 +25,10 @@ public class SysUserEditParam {
     private String username;
 
     /** 密码 */
-    @Size(min=8,max=20,message = "密码长度不能大于20,不能小于8")
-    @Schema(description = "密码")
-    @NotNull(message = "登录密码不能为空")
-    private String password;
+//    @Size(min=8,max=20,message = "密码长度不能大于20,不能小于8")
+//    @Schema(description = "密码")
+//    @NotNull(message = "登录密码不能为空")
+//    private String password;
 
     /** 手机号 */
     @Schema(description = "手机号")

+ 0 - 12
commons/src/main/java/com/jzg/commons/entity/po/SysUser.java

@@ -46,16 +46,6 @@ public class SysUser extends BaseModel{
     @Schema(description = "用户状态 : 1 正常 0 锁定")
     private Integer accountStatus;
 
-    /** 系统code */
-    @Schema(description = "系统code")
-    private String systemCode;
-
-    /** 非数据库字段 */
-
-    /** 角色名称集合 */
-    @TableField(exist = false)
-    private String roleNames;
-
     public SysUser(SysSystemAddParam param) {
         this.username = param.getUserName();
         this.mobile = param.getUserAccount();
@@ -63,12 +53,10 @@ public class SysUser extends BaseModel{
         String encryptedPassword = PasswordUtils.encode("12345678",salt);
         this.password = encryptedPassword;
         this.accountStatus = 1;
-        this.systemCode = param.getSysCode();
     }
 
     public SysUser(SysSystemEditParam param) {
         this.username = param.getUserName();
         this.mobile = param.getUserAccount();
-        this.systemCode = param.getSysCode();
     }
 }

+ 0 - 96
commons/src/main/java/com/jzg/commons/util/Threads.java

@@ -1,96 +0,0 @@
-package com.jzg.commons.util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.concurrent.*;
-
-/**
- * 线程相关工具类.
- * 
- * @author dongxin
- */
-public class Threads
-{
-    private static final Logger logger = LoggerFactory.getLogger(Threads.class);
-
-    /**
-     * sleep等待,单位为毫秒
-     */
-    public static void sleep(long milliseconds)
-    {
-        try
-        {
-            Thread.sleep(milliseconds);
-        }
-        catch (InterruptedException e)
-        {
-            return;
-        }
-    }
-
-    /**
-     * 停止线程池
-     * 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务.
-     * 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数.
-     * 如果仍然超時,則強制退出.
-     * 另对在shutdown时线程本身被调用中断做了处理.
-     */
-    public static void shutdownAndAwaitTermination(ExecutorService pool)
-    {
-        if (pool != null && !pool.isShutdown())
-        {
-            pool.shutdown();
-            try
-            {
-                if (!pool.awaitTermination(120, TimeUnit.SECONDS))
-                {
-                    pool.shutdownNow();
-                    if (!pool.awaitTermination(120, TimeUnit.SECONDS))
-                    {
-                        logger.info("Pool did not terminate");
-                    }
-                }
-            }
-            catch (InterruptedException ie)
-            {
-                pool.shutdownNow();
-                Thread.currentThread().interrupt();
-            }
-        }
-    }
-
-    /**
-     * 打印线程异常信息
-     */
-    public static void printException(Runnable r, Throwable t)
-    {
-        if (t == null && r instanceof Future<?>)
-        {
-            try
-            {
-                Future<?> future = (Future<?>) r;
-                if (future.isDone())
-                {
-                    future.get();
-                }
-            }
-            catch (CancellationException ce)
-            {
-                t = ce;
-            }
-            catch (ExecutionException ee)
-            {
-                t = ee.getCause();
-            }
-            catch (InterruptedException ie)
-            {
-                Thread.currentThread().interrupt();
-            }
-        }
-        if (t != null)
-        {
-            logger.error(t.getMessage(), t);
-        }
-    }
-}

+ 0 - 79
commons/src/main/java/com/jzg/commons/util/TreeBuildUtils.java

@@ -1,79 +0,0 @@
-package com.jzg.commons.util;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.lang.tree.Tree;
-import cn.hutool.core.lang.tree.TreeNodeConfig;
-import cn.hutool.core.lang.tree.TreeUtil;
-import cn.hutool.core.lang.tree.parser.NodeParser;
-import com.jzg.commons.util.reflect.ReflectUtils;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-/**
- * 扩展 hutool TreeUtil 封装系统树构建
- *
- * @author dongxin
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class TreeBuildUtils extends TreeUtil {
-
-    /**
-     * 根据前端定制差异化字段
-     */
-    public static final TreeNodeConfig DEFAULT_CONFIG = TreeNodeConfig.DEFAULT_CONFIG.setNameKey("label");
-
-    /**
-     * 构建树形结构
-     *
-     * @param <T>        输入节点的类型
-     * @param <K>        节点ID的类型
-     * @param list       节点列表,其中包含了要构建树形结构的所有节点
-     * @param nodeParser 解析器,用于将输入节点转换为树节点
-     * @return 构建好的树形结构列表
-     */
-    public static <T, K> List<Tree<K>> build(List<T> list, NodeParser<T, K> nodeParser) {
-        if (CollUtil.isEmpty(list)) {
-            return CollUtil.newArrayList();
-        }
-        K k = ReflectUtils.invokeGetter(list.get(0), "parentId");
-        return TreeUtil.build(list, k, DEFAULT_CONFIG, nodeParser);
-    }
-
-    /**
-     * 获取节点列表中所有节点的叶子节点
-     *
-     * @param <K>   节点ID的类型
-     * @param nodes 节点列表
-     * @return 包含所有叶子节点的列表
-     */
-    public static <K> List<Tree<K>> getLeafNodes(List<Tree<K>> nodes) {
-        if (CollUtil.isEmpty(nodes)) {
-            return CollUtil.newArrayList();
-        }
-        return nodes.stream()
-            .flatMap(TreeBuildUtils::extractLeafNodes)
-            .collect(Collectors.toList());
-    }
-
-    /**
-     * 获取指定节点下的所有叶子节点
-     *
-     * @param <K>  节点ID的类型
-     * @param node 要查找叶子节点的根节点
-     * @return 包含所有叶子节点的列表
-     */
-    private static <K> Stream<Tree<K>> extractLeafNodes(Tree<K> node) {
-        if (!node.hasChild()) {
-            return Stream.of(node);
-        } else {
-            // 递归调用,获取所有子节点的叶子节点
-            return node.getChildren().stream()
-                .flatMap(TreeBuildUtils::extractLeafNodes);
-        }
-    }
-
-}

+ 0 - 52
commons/src/main/java/com/jzg/commons/util/ip/AddressUtils.java

@@ -1,52 +0,0 @@
-package com.jzg.commons.util.ip;
-
-import com.alibaba.fastjson2.JSON;
-import com.alibaba.fastjson2.JSONObject;
-import com.jzg.commons.constants.Constants;
-import com.jzg.commons.util.StringUtils;
-import com.jzg.commons.util.http.HttpUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 获取地址类
- * 
- * @author dongxin
- */
-public class AddressUtils
-{
-    private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
-
-    // IP地址查询
-    public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp";
-
-    // 未知地址
-    public static final String UNKNOWN = "XX XX";
-
-    public static String getRealAddressByIP(String ip)
-    {
-        // 内网不查询
-        if (IpUtils.internalIp(ip))
-        {
-            return "内网IP";
-        }
-        try
-        {
-            String rspStr = HttpUtils.sendGet(IP_URL, "ip=" + ip + "&json=true", Constants.GBK);
-            if (StringUtils.isEmpty(rspStr))
-            {
-                log.error("获取地理位置异常 {}", ip);
-                return UNKNOWN;
-            }
-            JSONObject obj = JSON.parseObject(rspStr);
-            String region = obj.getString("pro");
-            String city = obj.getString("city");
-            return String.format("%s %s", region, city);
-        }
-        catch (Exception e)
-        {
-            log.error("获取地理位置异常 {}", ip);
-        }
-        return UNKNOWN;
-    }
-}

+ 0 - 384
commons/src/main/java/com/jzg/commons/util/ip/IpUtils.java

@@ -1,384 +0,0 @@
-package com.jzg.commons.util.ip;
-
-
-import com.jzg.commons.util.ServletUtils;
-import com.jzg.commons.util.StringUtils;
-import jakarta.servlet.http.HttpServletRequest;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * 获取IP方法
- * 
- * @author dongxin
- */
-public class IpUtils
-{
-    public final static String REGX_0_255 = "(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)";
-    // 匹配 ip
-    public final static String REGX_IP = "((" + REGX_0_255 + "\\.){3}" + REGX_0_255 + ")";
-    public final static String REGX_IP_WILDCARD = "(((\\*\\.){3}\\*)|(" + REGX_0_255 + "(\\.\\*){3})|(" + REGX_0_255 + "\\." + REGX_0_255 + ")(\\.\\*){2}" + "|((" + REGX_0_255 + "\\.){3}\\*))";
-    // 匹配网段
-    public final static String REGX_IP_SEG = "(" + REGX_IP + "\\-" + REGX_IP + ")";
-
-    /**
-     * 获取客户端IP
-     * 
-     * @return IP地址
-     */
-    public static String getIpAddr()
-    {
-        return getIpAddr(ServletUtils.getRequest());
-    }
-
-    /**
-     * 获取客户端IP
-     * 
-     * @param request 请求对象
-     * @return IP地址
-     */
-    public static String getIpAddr(HttpServletRequest request)
-    {
-        if (request == null)
-        {
-            return "unknown";
-        }
-        String ip = request.getHeader("x-forwarded-for");
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
-            ip = request.getHeader("Proxy-Client-IP");
-        }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
-            ip = request.getHeader("X-Forwarded-For");
-        }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
-            ip = request.getHeader("WL-Proxy-Client-IP");
-        }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
-            ip = request.getHeader("X-Real-IP");
-        }
-
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
-            ip = request.getRemoteAddr();
-        }
-
-        return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : getMultistageReverseProxyIp(ip);
-    }
-
-    /**
-     * 检查是否为内部IP地址
-     * 
-     * @param ip IP地址
-     * @return 结果
-     */
-    public static boolean internalIp(String ip)
-    {
-        byte[] addr = textToNumericFormatV4(ip);
-        return internalIp(addr) || "127.0.0.1".equals(ip);
-    }
-
-    /**
-     * 检查是否为内部IP地址
-     * 
-     * @param addr byte地址
-     * @return 结果
-     */
-    private static boolean internalIp(byte[] addr)
-    {
-        if (StringUtils.isNull(addr) || addr.length < 2)
-        {
-            return true;
-        }
-        final byte b0 = addr[0];
-        final byte b1 = addr[1];
-        // 10.x.x.x/8
-        final byte SECTION_1 = 0x0A;
-        // 172.16.x.x/12
-        final byte SECTION_2 = (byte) 0xAC;
-        final byte SECTION_3 = (byte) 0x10;
-        final byte SECTION_4 = (byte) 0x1F;
-        // 192.168.x.x/16
-        final byte SECTION_5 = (byte) 0xC0;
-        final byte SECTION_6 = (byte) 0xA8;
-        switch (b0)
-        {
-            case SECTION_1:
-                return true;
-            case SECTION_2:
-                if (b1 >= SECTION_3 && b1 <= SECTION_4)
-                {
-                    return true;
-                }
-            case SECTION_5:
-                switch (b1)
-                {
-                    case SECTION_6:
-                        return true;
-                }
-            default:
-                return false;
-        }
-    }
-
-    /**
-     * 将IPv4地址转换成字节
-     * 
-     * @param text IPv4地址
-     * @return byte 字节
-     */
-    public static byte[] textToNumericFormatV4(String text)
-    {
-        if (text.length() == 0)
-        {
-            return null;
-        }
-
-        byte[] bytes = new byte[4];
-        String[] elements = text.split("\\.", -1);
-        try
-        {
-            long l;
-            int i;
-            switch (elements.length)
-            {
-                case 1:
-                    l = Long.parseLong(elements[0]);
-                    if ((l < 0L) || (l > 4294967295L))
-                    {
-                        return null;
-                    }
-                    bytes[0] = (byte) (int) (l >> 24 & 0xFF);
-                    bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF);
-                    bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
-                    bytes[3] = (byte) (int) (l & 0xFF);
-                    break;
-                case 2:
-                    l = Integer.parseInt(elements[0]);
-                    if ((l < 0L) || (l > 255L))
-                    {
-                        return null;
-                    }
-                    bytes[0] = (byte) (int) (l & 0xFF);
-                    l = Integer.parseInt(elements[1]);
-                    if ((l < 0L) || (l > 16777215L))
-                    {
-                        return null;
-                    }
-                    bytes[1] = (byte) (int) (l >> 16 & 0xFF);
-                    bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
-                    bytes[3] = (byte) (int) (l & 0xFF);
-                    break;
-                case 3:
-                    for (i = 0; i < 2; ++i)
-                    {
-                        l = Integer.parseInt(elements[i]);
-                        if ((l < 0L) || (l > 255L))
-                        {
-                            return null;
-                        }
-                        bytes[i] = (byte) (int) (l & 0xFF);
-                    }
-                    l = Integer.parseInt(elements[2]);
-                    if ((l < 0L) || (l > 65535L))
-                    {
-                        return null;
-                    }
-                    bytes[2] = (byte) (int) (l >> 8 & 0xFF);
-                    bytes[3] = (byte) (int) (l & 0xFF);
-                    break;
-                case 4:
-                    for (i = 0; i < 4; ++i)
-                    {
-                        l = Integer.parseInt(elements[i]);
-                        if ((l < 0L) || (l > 255L))
-                        {
-                            return null;
-                        }
-                        bytes[i] = (byte) (int) (l & 0xFF);
-                    }
-                    break;
-                default:
-                    return null;
-            }
-        }
-        catch (NumberFormatException e)
-        {
-            return null;
-        }
-        return bytes;
-    }
-
-    /**
-     * 获取IP地址
-     * 
-     * @return 本地IP地址
-     */
-    public static String getHostIp()
-    {
-        try
-        {
-            return InetAddress.getLocalHost().getHostAddress();
-        }
-        catch (UnknownHostException e)
-        {
-        }
-        return "127.0.0.1";
-    }
-
-    /**
-     * 获取主机名
-     * 
-     * @return 本地主机名
-     */
-    public static String getHostName()
-    {
-        try
-        {
-            return InetAddress.getLocalHost().getHostName();
-        }
-        catch (UnknownHostException e)
-        {
-        }
-        return "未知";
-    }
-
-    /**
-     * 从多级反向代理中获得第一个非unknown IP地址
-     *
-     * @param ip 获得的IP地址
-     * @return 第一个非unknown IP地址
-     */
-    public static String getMultistageReverseProxyIp(String ip)
-    {
-        // 多级反向代理检测
-        if (ip != null && ip.indexOf(",") > 0)
-        {
-            final String[] ips = ip.trim().split(",");
-            for (String subIp : ips)
-            {
-                if (false == isUnknown(subIp))
-                {
-                    ip = subIp;
-                    break;
-                }
-            }
-        }
-        return StringUtils.substring(ip, 0, 255);
-    }
-
-    /**
-     * 检测给定字符串是否为未知,多用于检测HTTP请求相关
-     *
-     * @param checkString 被检测的字符串
-     * @return 是否未知
-     */
-    public static boolean isUnknown(String checkString)
-    {
-        return StringUtils.isBlank(checkString) || "unknown".equalsIgnoreCase(checkString);
-    }
-
-    /**
-     * 是否为IP
-     */
-    public static boolean isIP(String ip)
-    {
-        return StringUtils.isNotBlank(ip) && ip.matches(REGX_IP);
-    }
-
-    /**
-     * 是否为IP,或 *为间隔的通配符地址
-     */
-    public static boolean isIpWildCard(String ip)
-    {
-        return StringUtils.isNotBlank(ip) && ip.matches(REGX_IP_WILDCARD);
-    }
-
-    /**
-     * 检测参数是否在ip通配符里
-     */
-    public static boolean ipIsInWildCardNoCheck(String ipWildCard, String ip)
-    {
-        String[] s1 = ipWildCard.split("\\.");
-        String[] s2 = ip.split("\\.");
-        boolean isMatchedSeg = true;
-        for (int i = 0; i < s1.length && !s1[i].equals("*"); i++)
-        {
-            if (!s1[i].equals(s2[i]))
-            {
-                isMatchedSeg = false;
-                break;
-            }
-        }
-        return isMatchedSeg;
-    }
-
-    /**
-     * 是否为特定格式如:“10.10.10.1-10.10.10.99”的ip段字符串
-     */
-    public static boolean isIPSegment(String ipSeg)
-    {
-        return StringUtils.isNotBlank(ipSeg) && ipSeg.matches(REGX_IP_SEG);
-    }
-
-    /**
-     * 判断ip是否在指定网段中
-     */
-    public static boolean ipIsInNetNoCheck(String iparea, String ip)
-    {
-        int idx = iparea.indexOf('-');
-        String[] sips = iparea.substring(0, idx).split("\\.");
-        String[] sipe = iparea.substring(idx + 1).split("\\.");
-        String[] sipt = ip.split("\\.");
-        long ips = 0L, ipe = 0L, ipt = 0L;
-        for (int i = 0; i < 4; ++i)
-        {
-            ips = ips << 8 | Integer.parseInt(sips[i]);
-            ipe = ipe << 8 | Integer.parseInt(sipe[i]);
-            ipt = ipt << 8 | Integer.parseInt(sipt[i]);
-        }
-        if (ips > ipe)
-        {
-            long t = ips;
-            ips = ipe;
-            ipe = t;
-        }
-        return ips <= ipt && ipt <= ipe;
-    }
-
-    /**
-     * 校验ip是否符合过滤串规则
-     * 
-     * @param filter 过滤IP列表,支持后缀'*'通配,支持网段如:`10.10.10.1-10.10.10.99`
-     * @param ip 校验IP地址
-     * @return boolean 结果
-     */
-    public static boolean isMatchedIp(String filter, String ip)
-    {
-        if (StringUtils.isEmpty(filter) || StringUtils.isEmpty(ip))
-        {
-            return false;
-        }
-        String[] ips = filter.split(";");
-        for (String iStr : ips)
-        {
-            if (isIP(iStr) && iStr.equals(ip))
-            {
-                return true;
-            }
-            else if (isIpWildCard(iStr) && ipIsInWildCardNoCheck(iStr, ip))
-            {
-                return true;
-            }
-            else if (isIPSegment(iStr) && ipIsInNetNoCheck(iStr, ip))
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-}

+ 1 - 1
commons/src/main/java/com/jzg/commons/util/spring/SpringUtils.java

@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
 /**
  * spring工具类 方便在非spring管理环境中获取bean
  * 
- * @author dongxin
+ * @author ruoyi
  */
 @Component
 public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware 

+ 0 - 265
platform/src/main/java/com/jzg/aop/aspect/LogAspect.java

@@ -1,265 +0,0 @@
-package com.jzg.aop.aspect;
-
-import com.alibaba.fastjson2.JSON;
-import com.jzg.commons.annotation.Log;
-import com.jzg.commons.core.base.BaseController;
-import com.jzg.commons.entity.enums.BusinessStatus;
-import com.jzg.commons.entity.enums.HttpMethod;
-import com.jzg.commons.entity.po.SysOperLog;
-import com.jzg.commons.filter.PropertyPreExcludeFilter;
-import com.jzg.manager.AsyncManager;
-import com.jzg.manager.factory.AsyncFactory;
-import com.jzg.commons.util.ip.IpUtils;
-import com.jzg.commons.util.ServletUtils;
-import com.jzg.commons.util.StringUtils;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-import org.apache.commons.lang3.ArrayUtils;
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.annotation.AfterReturning;
-import org.aspectj.lang.annotation.AfterThrowing;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Before;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.NamedThreadLocal;
-import org.springframework.stereotype.Component;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * 操作日志记录处理
- * 
- * @author dongxin
- */
-@Aspect
-@Component
-public class LogAspect
-{
-    private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
-
-    /** 排除敏感属性字段 */
-    public static final String[] EXCLUDE_PROPERTIES = { "password", "oldPassword", "newPassword", "confirmPassword" };
-
-    /** 计算操作消耗时间 */
-    private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<Long>("Cost Time");
-
-    @Autowired
-    private BaseController baseController;
-
-    /**
-     * 处理请求前执行
-     */
-    @Before(value = "@annotation(controllerLog)")
-    public void boBefore(JoinPoint joinPoint, Log controllerLog)
-    {
-        TIME_THREADLOCAL.set(System.currentTimeMillis());
-    }
-
-    /**
-     * 处理完请求后执行
-     *
-     * @param joinPoint 切点
-     */
-    @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult")
-    public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult)
-    {
-        handleLog(joinPoint, controllerLog, null, jsonResult);
-    }
-
-    /**
-     * 拦截异常操作
-     * 
-     * @param joinPoint 切点
-     * @param e 异常
-     */
-    @AfterThrowing(value = "@annotation(controllerLog)", throwing = "e")
-    public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e)
-    {
-        handleLog(joinPoint, controllerLog, e, null);
-    }
-
-    protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult)
-    {
-        try
-        {
-            // 获取当前的用户
-            String userName = baseController.getUserName();
-            String systemId = baseController.getUserLoginSystem();
-
-            // *========数据库日志=========*//
-            SysOperLog operLog = new SysOperLog();
-            operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
-            // 请求的地址
-            String ip = IpUtils.getIpAddr();
-            operLog.setOperIp(ip);
-            operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255));
-            if(StringUtils.isNotEmpty(userName))
-            {
-                operLog.setOperName(userName);
-                operLog.setSysCode(systemId);
-                operLog.setDeptName("");
-            }
-//            if (loginUser != null)
-//            {
-//                operLog.setOperName(loginUser.getUsername());
-//                SysUser currentUser = loginUser.getUser();
-//                if (StringUtils.isNotNull(currentUser) && StringUtils.isNotNull(currentUser.getDept()))
-//                {
-//                    operLog.setDeptName(currentUser.getDept().getDeptName());
-//                }
-//            }
-
-            if (e != null)
-            {
-                operLog.setStatus(BusinessStatus.FAIL.ordinal());
-                operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
-            }
-            // 设置方法名称
-            String className = joinPoint.getTarget().getClass().getName();
-            String methodName = joinPoint.getSignature().getName();
-            operLog.setMethod(className + "." + methodName + "()");
-            // 设置请求方式
-            operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
-            // 处理设置注解上的参数
-            getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult);
-            // 设置消耗时间
-            operLog.setCostTime(System.currentTimeMillis() - TIME_THREADLOCAL.get());
-            // 保存数据库
-            AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
-        }
-        catch (Exception exp)
-        {
-            // 记录本地异常日志
-            log.error("异常信息:{}", exp.getMessage());
-            exp.printStackTrace();
-        }
-        finally
-        {
-            TIME_THREADLOCAL.remove();
-        }
-    }
-
-    /**
-     * 获取注解中对方法的描述信息 用于Controller层注解
-     * 
-     * @param log 日志
-     * @param operLog 操作日志
-     * @throws Exception
-     */
-    public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog, Object jsonResult) throws Exception
-    {
-        // 设置action动作
-        operLog.setBusinessType(log.businessType().ordinal());
-        // 设置标题
-        operLog.setTitle(log.title());
-        // 设置操作人类别
-        operLog.setOperatorType(log.operatorType().ordinal());
-        // 是否需要保存request,参数和值
-        if (log.isSaveRequestData())
-        {
-            // 获取参数的信息,传入到数据库中。
-            setRequestValue(joinPoint, operLog, log.excludeParamNames());
-        }
-        // 是否需要保存response,参数和值
-        if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult))
-        {
-            operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
-        }
-    }
-
-    /**
-     * 获取请求的参数,放到log中
-     * 
-     * @param operLog 操作日志
-     * @throws Exception 异常
-     */
-    private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog, String[] excludeParamNames) throws Exception
-    {
-        Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
-        String requestMethod = operLog.getRequestMethod();
-        if (StringUtils.isEmpty(paramsMap)
-                && (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)))
-        {
-            String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
-            operLog.setOperParam(StringUtils.substring(params, 0, 2000));
-        }
-        else
-        {
-            operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter(excludeParamNames)), 0, 2000));
-        }
-    }
-
-    /**
-     * 参数拼装
-     */
-    private String argsArrayToString(Object[] paramsArray, String[] excludeParamNames)
-    {
-        String params = "";
-        if (paramsArray != null && paramsArray.length > 0)
-        {
-            for (Object o : paramsArray)
-            {
-                if (StringUtils.isNotNull(o) && !isFilterObject(o))
-                {
-                    try
-                    {
-                        String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter(excludeParamNames));
-                        params += jsonObj.toString() + " ";
-                    }
-                    catch (Exception e)
-                    {
-                    }
-                }
-            }
-        }
-        return params.trim();
-    }
-
-    /**
-     * 忽略敏感属性
-     */
-    public PropertyPreExcludeFilter excludePropertyPreFilter(String[] excludeParamNames)
-    {
-        return new PropertyPreExcludeFilter().addExcludes(ArrayUtils.addAll(EXCLUDE_PROPERTIES, excludeParamNames));
-    }
-
-    /**
-     * 判断是否需要过滤的对象。
-     * 
-     * @param o 对象信息。
-     * @return 如果是需要过滤的对象,则返回true;否则返回false。
-     */
-    @SuppressWarnings("rawtypes")
-    public boolean isFilterObject(final Object o)
-    {
-        Class<?> clazz = o.getClass();
-        if (clazz.isArray())
-        {
-            return clazz.getComponentType().isAssignableFrom(MultipartFile.class);
-        }
-        else if (Collection.class.isAssignableFrom(clazz))
-        {
-            Collection collection = (Collection) o;
-            for (Object value : collection)
-            {
-                return value instanceof MultipartFile;
-            }
-        }
-        else if (Map.class.isAssignableFrom(clazz))
-        {
-            Map map = (Map) o;
-            for (Object value : map.entrySet())
-            {
-                Map.Entry entry = (Map.Entry) value;
-                return entry.getValue() instanceof MultipartFile;
-            }
-        }
-        return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse
-                || o instanceof BindingResult;
-    }
-}

+ 0 - 11
platform/src/main/java/com/jzg/controller/SysSystemController.java

@@ -1,17 +1,11 @@
 package com.jzg.controller;
 
-import cn.hutool.core.collection.CollUtil;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jzg.commons.annotation.Log;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.SysSystemAddParam;
 import com.jzg.commons.entity.dto.SysSystemEditParam;
 import com.jzg.commons.entity.dto.SysSystemParam;
-import com.jzg.commons.entity.enums.BusinessType;
 import com.jzg.commons.entity.enums.YesNoEnum;
-import com.jzg.commons.entity.po.SysSystem;
-import com.jzg.commons.entity.vo.SysRoleVo;
 import com.jzg.commons.entity.vo.SysSystemPermsVo;
 import com.jzg.commons.entity.vo.SysSystemVo;
 import com.jzg.commons.entity.vo.UpAndDownVo;
@@ -20,7 +14,6 @@ import com.jzg.commons.util.StringUtils;
 import com.jzg.service.SysSystemService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
-import jakarta.validation.constraints.NotEmpty;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -83,7 +76,6 @@ public class SysSystemController {
      * @param param
      * @return
      */
-    @Log(title = "租户管理", businessType = BusinessType.INSERT)
     @Operation(summary = "租户添加")
     @PostMapping("/sysAdd")
     public HttpResult sysAdd(@Validated @RequestBody SysSystemAddParam param) {
@@ -101,7 +93,6 @@ public class SysSystemController {
      * @param param
      * @return
      */
-    @Log(title = "租户管理", businessType = BusinessType.UPDATE)
     @Operation(summary = "租户修改")
     @PutMapping("/sysEdit")
     public HttpResult sysEdit(@Validated @RequestBody SysSystemEditParam param) {
@@ -119,7 +110,6 @@ public class SysSystemController {
      *
      * @param ids 主键串
      */
-    @Log(title = "租户管理", businessType = BusinessType.DELETE)
     @Operation(summary = "批量删除租户")
     @DeleteMapping("/sysDelete")
     public HttpResult remove(String[] ids) {
@@ -134,7 +124,6 @@ public class SysSystemController {
      * @param upAndDownVo
      * @return
      */
-    @Log(title = "租户管理", businessType = BusinessType.UPDATE)
     @PostMapping("/sysUpAndDown")
     @Operation(summary = "启用/禁用租户")
     public HttpResult upAndDown(@RequestBody UpAndDownVo upAndDownVo) {

+ 0 - 11
platform/src/main/java/com/jzg/controller/SysUserController.java

@@ -1,24 +1,17 @@
 package com.jzg.controller;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jzg.commons.annotation.Log;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.SysUserAddParam;
 import com.jzg.commons.entity.dto.SysUserEditParam;
 import com.jzg.commons.entity.dto.SysUserParam;
-import com.jzg.commons.entity.enums.BusinessType;
 import com.jzg.commons.entity.enums.YesNoEnum;
-import com.jzg.commons.entity.vo.SysUserVo;
 import com.jzg.commons.entity.vo.UpAndDownVo;
 import com.jzg.commons.util.AssertionUtils;
-import com.jzg.commons.util.StringUtils;
-import com.jzg.service.SysUserService;
-import com.jzg.commons.entity.vo.SysUserVo;
 import com.jzg.service.SysUserService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
-import jakarta.validation.constraints.NotEmpty;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -67,7 +60,6 @@ public class SysUserController extends BaseController {
      * @param param
      * @return
      */
-    @Log(title = "平台用户管理", businessType = BusinessType.INSERT)
     @Operation(summary = "平台用户添加")
     @PostMapping("/userAdd")
     public HttpResult userAdd(@Validated @RequestBody SysUserAddParam param) {
@@ -83,7 +75,6 @@ public class SysUserController extends BaseController {
      * @param param
      * @return
      */
-    @Log(title = "平台用户管理", businessType = BusinessType.UPDATE)
     @Operation(summary = "平台用户修改")
     @PutMapping("/userEdit")
     public HttpResult userEdit(@Validated @RequestBody SysUserEditParam param) {
@@ -99,7 +90,6 @@ public class SysUserController extends BaseController {
      *
      * @param ids 主键串
      */
-    @Log(title = "平台用户管理", businessType = BusinessType.DELETE)
     @Operation(summary = "批量删除平台用户")
     @DeleteMapping("/userDelete")
     public HttpResult remove(String[] ids) {
@@ -114,7 +104,6 @@ public class SysUserController extends BaseController {
      * @param upAndDownVo
      * @return
      */
-    @Log(title = "平台用户管理", businessType = BusinessType.UPDATE)
     @PostMapping("/upAndDown/")
     @Operation(summary = "启用/禁用平台用户")
     public HttpResult upAndDown(@RequestBody UpAndDownVo upAndDownVo) {

+ 0 - 57
platform/src/main/java/com/jzg/manager/AsyncManager.java

@@ -1,57 +0,0 @@
-package com.jzg.manager;
-
-import com.jzg.commons.util.Threads;
-import com.jzg.commons.util.spring.SpringUtils;
-import org.springframework.stereotype.Component;
-
-import java.util.TimerTask;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 异步任务管理器
- * 
- * @author dongxin
- */
-public class AsyncManager
-{
-    /**
-     * 操作延迟10毫秒
-     */
-    private final int OPERATE_DELAY_TIME = 10;
-
-    /**
-     * 异步操作任务调度线程池
-     */
-    private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService");
-
-    /**
-     * 单例模式
-     */
-    private AsyncManager(){}
-
-    private static AsyncManager me = new AsyncManager();
-
-    public static AsyncManager me()
-    {
-        return me;
-    }
-
-    /**
-     * 执行任务
-     * 
-     * @param task 任务
-     */
-    public void execute(TimerTask task)
-    {
-        executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS);
-    }
-
-    /**
-     * 停止任务线程池
-     */
-    public void shutdown()
-    {
-        Threads.shutdownAndAwaitTermination(executor);
-    }
-}

+ 0 - 39
platform/src/main/java/com/jzg/manager/ShutdownManager.java

@@ -1,39 +0,0 @@
-package com.jzg.manager;
-
-import jakarta.annotation.PreDestroy;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-/**
- * 确保应用退出时能关闭后台线程
- *
- * @author dongxin
- */
-@Component
-public class ShutdownManager
-{
-    private static final Logger logger = LoggerFactory.getLogger("sys-user");
-
-    @PreDestroy
-    public void destroy()
-    {
-        shutdownAsyncManager();
-    }
-
-    /**
-     * 停止异步执行任务
-     */
-    private void shutdownAsyncManager()
-    {
-        try
-        {
-            logger.info("====关闭后台任务任务线程池====");
-            AsyncManager.me().shutdown();
-        }
-        catch (Exception e)
-        {
-            logger.error(e.getMessage(), e);
-        }
-    }
-}

+ 0 - 97
platform/src/main/java/com/jzg/manager/factory/AsyncFactory.java

@@ -1,97 +0,0 @@
-package com.jzg.manager.factory;
-
-import com.jzg.commons.entity.po.SysOperLog;
-import com.jzg.service.SysOperLogService;
-import com.jzg.commons.entity.po.SysOperLog;
-import com.jzg.commons.util.ip.AddressUtils;
-import com.jzg.commons.util.spring.SpringUtils;
-import com.jzg.service.SysOperLogService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.TimerTask;
-
-/**
- * 异步工厂(产生任务用)
- * 
- * @author dongxin
- */
-public class AsyncFactory
-{
-    private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user");
-
-//    /**
-//     * 记录登录信息
-//     *
-//     * @param username 用户名
-//     * @param status 状态
-//     * @param message 消息
-//     * @param args 列表
-//     * @return 任务task
-//     */
-//    public static TimerTask recordLogininfor(final String username, final String status, final String message,
-//            final Object... args)
-//    {
-//        final UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
-//        final String ip = IpUtils.getIpAddr();
-//        return new TimerTask()
-//        {
-//            @Override
-//            public void run()
-//            {
-//                String address = AddressUtils.getRealAddressByIP(ip);
-//                StringBuilder s = new StringBuilder();
-//                s.append(LogUtils.getBlock(ip));
-//                s.append(address);
-//                s.append(LogUtils.getBlock(username));
-//                s.append(LogUtils.getBlock(status));
-//                s.append(LogUtils.getBlock(message));
-//                // 打印信息到日志
-//                sys_user_logger.info(s.toString(), args);
-//                // 获取客户端操作系统
-//                String os = userAgent.getOperatingSystem().getName();
-//                // 获取客户端浏览器
-//                String browser = userAgent.getBrowser().getName();
-//                // 封装对象
-//                SysLogininfor logininfor = new SysLogininfor();
-//                logininfor.setUserName(username);
-//                logininfor.setIpaddr(ip);
-//                logininfor.setLoginLocation(address);
-//                logininfor.setBrowser(browser);
-//                logininfor.setOs(os);
-//                logininfor.setMsg(message);
-//                // 日志状态
-//                if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER))
-//                {
-//                    logininfor.setStatus(Constants.SUCCESS);
-//                }
-//                else if (Constants.LOGIN_FAIL.equals(status))
-//                {
-//                    logininfor.setStatus(Constants.FAIL);
-//                }
-//                // 插入数据
-//                SpringUtils.getBean(ISysLogininforService.class).insertLogininfor(logininfor);
-//            }
-//        };
-//    }
-
-    /**
-     * 操作日志记录
-     * 
-     * @param operLog 操作日志信息
-     * @return 任务task
-     */
-    public static TimerTask recordOper(final SysOperLog operLog)
-    {
-        return new TimerTask()
-        {
-            @Override
-            public void run()
-            {
-                // 远程查询操作地点
-                operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
-                SpringUtils.getBean(SysOperLogService.class).insertOperlog(operLog);
-            }
-        };
-    }
-}

+ 6 - 6
platform/src/main/java/com/jzg/service/impl/SysOperLogServiceImpl.java

@@ -19,7 +19,7 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
         implements SysOperLogService
 {
     @Autowired
-    private SysOperLogMapper operLogMapper;
+    private SysOperLogMapper sysOperLogMapper;
 
     /**
      * 新增操作日志
@@ -29,7 +29,7 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
     @Override
     public void insertOperlog(SysOperLog operLog)
     {
-        operLogMapper.insertOperlog(operLog);
+        sysOperLogMapper.insertOperlog(operLog);
     }
 
     /**
@@ -41,7 +41,7 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
     @Override
     public List<SysOperLog> selectOperLogList(SysOperLog operLog)
     {
-        return operLogMapper.selectOperLogList(operLog);
+        return sysOperLogMapper.selectOperLogList(operLog);
     }
 
     /**
@@ -53,7 +53,7 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
     @Override
     public int deleteOperLogByIds(Long[] operIds)
     {
-        return operLogMapper.deleteOperLogByIds(operIds);
+        return sysOperLogMapper.deleteOperLogByIds(operIds);
     }
 
     /**
@@ -65,7 +65,7 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
     @Override
     public SysOperLog selectOperLogById(Long operId)
     {
-        return operLogMapper.selectOperLogById(operId);
+        return sysOperLogMapper.selectOperLogById(operId);
     }
 
     /**
@@ -74,6 +74,6 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
     @Override
     public void cleanOperLog()
     {
-        operLogMapper.cleanOperLog();
+        sysOperLogMapper.cleanOperLog();
     }
 }

+ 1 - 4
platform/src/main/java/com/jzg/service/impl/SysUserServiceImpl.java

@@ -89,7 +89,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
         BeanUtils.copyProperties(param, user);
         user.setAccountStatus(1);
         String salt = PasswordUtils.getSalt();
-        String encryptedPassword = PasswordUtils.encode(param.getPassword(),salt);
+        String encryptedPassword = PasswordUtils.encode("12345678",salt);
         user.setSalt(salt);
         user.setPassword(encryptedPassword);
         this.save(user);
@@ -110,9 +110,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
     public void userEdit(SysUserEditParam param) {
         SysUser user = new SysUser();
         BeanUtils.copyProperties(param, user);
-        SysUser sysUser = this.getById(user.getId());
-        String encryptedPassword = PasswordUtils.encode(param.getPassword(),sysUser.getSalt());
-        user.setPassword(encryptedPassword);
         this.updateById(user);
 
         // 删除当前用户与角色的关联信息