提交 f20d5cc3 authored 作者: Matrix's avatar Matrix

fix(基础配置): 增加了路径映射部分

url 路径 /reports/** -> resources/reports 下的文件 作了映射
上级 cfb7c87a
package org.matrix.autotest.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* ResourcesConfig.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2022/3/17 at 10:25 AM
* Suffering is the most powerful teacher of life.
*/
@Configuration
public class ResourcesConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/reports/**").addResourceLocations("classpath:/reports/");
}
}
...@@ -17,7 +17,8 @@ public class PageTools { ...@@ -17,7 +17,8 @@ public class PageTools {
length = length + 1; length = length + 1;
} }
if (pageNum > length) { if (pageNum > length) {
throw new GlobalException("您查询的页码已经超出范围"); throw new GlobalException(String
.format("您查询的页码已经超出范围,允许查询的最大页码是 %d,您查询的页码是 %d",length,pageNum));
} }
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论