mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 08:13:44 +08:00 
			
		
		
		
	fix 修复 可能导致异常类无法反序列化问题
This commit is contained in:
		@@ -1,5 +1,10 @@
 | 
			
		||||
package org.dromara.common.core.exception;
 | 
			
		||||
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -7,6 +12,10 @@ import java.io.Serial;
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class GlobalException extends RuntimeException {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
@@ -22,12 +31,6 @@ public class GlobalException extends RuntimeException {
 | 
			
		||||
     */
 | 
			
		||||
    private String detailMessage;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 空构造方法,避免反序列化问题
 | 
			
		||||
     */
 | 
			
		||||
    public GlobalException() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public GlobalException(String message) {
 | 
			
		||||
        this.message = message;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,10 @@
 | 
			
		||||
package org.dromara.common.core.exception;
 | 
			
		||||
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -7,6 +12,10 @@ import java.io.Serial;
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public final class ServiceException extends RuntimeException {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
@@ -27,12 +36,6 @@ public final class ServiceException extends RuntimeException {
 | 
			
		||||
     */
 | 
			
		||||
    private String detailMessage;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 空构造方法,避免反序列化问题
 | 
			
		||||
     */
 | 
			
		||||
    public ServiceException() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public ServiceException(String message) {
 | 
			
		||||
        this.message = message;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,6 @@
 | 
			
		||||
package org.dromara.common.core.exception.base;
 | 
			
		||||
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import org.dromara.common.core.utils.MessageUtils;
 | 
			
		||||
import org.dromara.common.core.utils.StringUtils;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
@@ -16,6 +17,7 @@ import java.io.Serial;
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class BaseException extends RuntimeException {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
@@ -41,13 +43,6 @@ public class BaseException extends RuntimeException {
 | 
			
		||||
     */
 | 
			
		||||
    private String defaultMessage;
 | 
			
		||||
 | 
			
		||||
    public BaseException(String module, String code, Object[] args, String defaultMessage) {
 | 
			
		||||
        this.module = module;
 | 
			
		||||
        this.code = code;
 | 
			
		||||
        this.args = args;
 | 
			
		||||
        this.defaultMessage = defaultMessage;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public BaseException(String module, String code, Object[] args) {
 | 
			
		||||
        this(module, code, args, null);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user