mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-11-04 10:57:10 +08:00 
			
		
		
		
	完善:发版前配置梳理
This commit is contained in:
		@@ -21,6 +21,7 @@ import java.lang.annotation.*;
 | 
			
		||||
/**
 | 
			
		||||
 * 查询注解
 | 
			
		||||
 *
 | 
			
		||||
 * @author Zheng Jie(ELADMIN)
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2023/1/15 18:01
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -59,8 +59,8 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
 | 
			
		||||
    @Override
 | 
			
		||||
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
 | 
			
		||||
        LocalStorageProperties.LocalStoragePath path = localStorageProperties.getPath();
 | 
			
		||||
        String avatarUtl = "file:" + path.getAvatar().replace("\\", "/");
 | 
			
		||||
        String fileUrl = "file:" + path.getFile().replace("\\", "/");
 | 
			
		||||
        String avatarUtl = "file:" + path.getAvatar().replace(StringConsts.BACKSLASH, StringConsts.SLASH);
 | 
			
		||||
        String fileUrl = "file:" + path.getFile().replace(StringConsts.BACKSLASH, StringConsts.SLASH);
 | 
			
		||||
        registry.addResourceHandler(localStorageProperties.getFilePattern()).addResourceLocations(fileUrl)
 | 
			
		||||
            .setCachePeriod(0);
 | 
			
		||||
        registry.addResourceHandler(localStorageProperties.getAvatarPattern()).addResourceLocations(avatarUtl)
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,7 @@ import cn.hutool.extra.spring.SpringUtil;
 | 
			
		||||
/**
 | 
			
		||||
 * RSA 配置属性
 | 
			
		||||
 *
 | 
			
		||||
 * @author Zheng Jie(ELADMIN)
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2022/12/21 20:21
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -35,6 +35,7 @@ import top.charles7c.cnadmin.common.exception.ServiceException;
 | 
			
		||||
/**
 | 
			
		||||
 * 异步任务执行配置
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li(RuoYi-Vue-Plus)
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2022/12/23 22:33
 | 
			
		||||
 */
 | 
			
		||||
@@ -47,7 +48,7 @@ public class AsyncConfiguration implements AsyncConfigurer {
 | 
			
		||||
    private final ScheduledExecutorService scheduledExecutorService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 异步任务执行时,使用 Java 内置线程池
 | 
			
		||||
     * 异步任务 @Async 执行时,使用 Java 内置线程池
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Executor getAsyncExecutor() {
 | 
			
		||||
 
 | 
			
		||||
@@ -34,6 +34,7 @@ import top.charles7c.cnadmin.common.util.ExceptionUtils;
 | 
			
		||||
/**
 | 
			
		||||
 * 线程池配置
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li(RuoYi-Vue-Plus)
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2022/12/23 23:13
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Component;
 | 
			
		||||
/**
 | 
			
		||||
 * 线程池配置属性
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li(RuoYi-Vue-Plus)
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2022/12/23 23:06
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -52,6 +52,7 @@ import top.charles7c.cnadmin.common.util.holder.LogContextHolder;
 | 
			
		||||
 * 全局异常处理器
 | 
			
		||||
 *
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @author Lion Li(RuoYi-Vue-Plus)
 | 
			
		||||
 * @since 2022/12/21 21:01
 | 
			
		||||
 */
 | 
			
		||||
@Slf4j
 | 
			
		||||
@@ -183,7 +184,6 @@ public class GlobalExceptionHandler {
 | 
			
		||||
    @ExceptionHandler(NotLoginException.class)
 | 
			
		||||
    public R handleNotLoginException(NotLoginException e, HttpServletRequest request) {
 | 
			
		||||
        log.error("请求地址 [{}],认证失败,无法访问系统资源。", request.getRequestURI(), e);
 | 
			
		||||
 | 
			
		||||
        String errorMsg;
 | 
			
		||||
        switch (e.getType()) {
 | 
			
		||||
            case NotLoginException.KICK_OUT:
 | 
			
		||||
@@ -196,7 +196,6 @@ public class GlobalExceptionHandler {
 | 
			
		||||
                errorMsg = "登录状态已过期,请重新登录";
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        LogContextHolder.setErrorMsg(errorMsg);
 | 
			
		||||
        return R.fail(HttpStatus.UNAUTHORIZED.value(), errorMsg);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -34,6 +34,7 @@ import top.charles7c.cnadmin.common.constant.StringConsts;
 | 
			
		||||
/**
 | 
			
		||||
 * 文件工具类
 | 
			
		||||
 *
 | 
			
		||||
 * @author Zheng Jie(ELADMIN)
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2023/1/2 21:34
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -33,6 +33,7 @@ import cn.hutool.extra.spring.SpringUtil;
 | 
			
		||||
/**
 | 
			
		||||
 * Redis 工具类
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li(RuoYi-Vue-Plus)
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2022/12/11 12:00
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -31,6 +31,7 @@ import top.charles7c.cnadmin.common.constant.StringConsts;
 | 
			
		||||
/**
 | 
			
		||||
 * Stream 工具类
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li(RuoYi-Vue-Plus)
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2022/12/22 19:51
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -38,6 +38,7 @@ import top.charles7c.cnadmin.common.util.holder.LogContextHolder;
 | 
			
		||||
/**
 | 
			
		||||
 * 登录助手
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li(RuoYi-Vue-Plus)
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2022/12/24 12:58
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -36,6 +36,7 @@ import top.charles7c.cnadmin.common.util.ReflectUtils;
 | 
			
		||||
/**
 | 
			
		||||
 * 查询助手
 | 
			
		||||
 *
 | 
			
		||||
 * @author Zheng Jie(ELADMIN)
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2023/1/15 18:17
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user