mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-14 20:33:40 +00:00
feat: 全局格式化代码
This commit is contained in:
@@ -34,20 +34,20 @@ public class ResourcesConfig implements WebMvcConfigurer {
|
||||
registry.addInterceptor(demoModeInterceptor)
|
||||
.addPathPatterns("/**") // 拦截所有路径
|
||||
.excludePathPatterns(
|
||||
// 排除静态资源
|
||||
"/css/**",
|
||||
"/js/**",
|
||||
"/images/**",
|
||||
"/fonts/**",
|
||||
"/favicon.ico",
|
||||
// 排除错误页面
|
||||
"/error",
|
||||
// 排除API文档
|
||||
"/*/api-docs/**",
|
||||
"/swagger-ui/**",
|
||||
"/webjars/**",
|
||||
// 排除监控端点
|
||||
"/actuator/**"
|
||||
// 排除静态资源
|
||||
"/css/**",
|
||||
"/js/**",
|
||||
"/images/**",
|
||||
"/fonts/**",
|
||||
"/favicon.ico",
|
||||
// 排除错误页面
|
||||
"/error",
|
||||
// 排除API文档
|
||||
"/*/api-docs/**",
|
||||
"/swagger-ui/**",
|
||||
"/webjars/**",
|
||||
// 排除监控端点
|
||||
"/actuator/**"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ public class RepeatableFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
throws IOException, ServletException {
|
||||
ServletRequest requestWrapper = null;
|
||||
if (request instanceof HttpServletRequest
|
||||
&& StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) {
|
||||
&& StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) {
|
||||
requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response);
|
||||
}
|
||||
if (null == requestWrapper) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class XssFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
throws IOException, ServletException {
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
HttpServletResponse resp = (HttpServletResponse) response;
|
||||
if (handleExcludeURL(req, resp)) {
|
||||
|
||||
@@ -51,9 +51,9 @@ public class DemoModeInterceptor implements HandlerInterceptor {
|
||||
*/
|
||||
private boolean isEditOperation(String method) {
|
||||
return "POST".equalsIgnoreCase(method)
|
||||
|| "PUT".equalsIgnoreCase(method)
|
||||
|| "DELETE".equalsIgnoreCase(method)
|
||||
|| "PATCH".equalsIgnoreCase(method);
|
||||
|| "PUT".equalsIgnoreCase(method)
|
||||
|| "DELETE".equalsIgnoreCase(method)
|
||||
|| "PATCH".equalsIgnoreCase(method);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,8 +32,8 @@ public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor {
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
String url = request.getMethod() + " " + request.getRequestURI();
|
||||
String domainName = request.getServerName();
|
||||
log.info("域名信息:{}",domainName);
|
||||
String domainName = request.getServerName();
|
||||
log.info("域名信息:{}", domainName);
|
||||
// 打印请求参数
|
||||
if (isJsonRequest(request)) {
|
||||
String jsonParam = "";
|
||||
|
||||
@@ -46,8 +46,8 @@ public class UnsignedMathGenerator implements CodeGenerator {
|
||||
final int limit = getLimit();
|
||||
int a = RandomUtil.randomInt(limit);
|
||||
int b = RandomUtil.randomInt(limit);
|
||||
String max = Integer.toString(Math.max(a,b));
|
||||
String min = Integer.toString(Math.min(a,b));
|
||||
String max = Integer.toString(Math.max(a, b));
|
||||
String min = Integer.toString(Math.min(a, b));
|
||||
max = StringUtils.rightPad(max, this.numberLength, CharUtil.SPACE);
|
||||
min = StringUtils.rightPad(min, this.numberLength, CharUtil.SPACE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user