注册接口

This commit is contained in:
dww
2026-02-03 10:21:26 +08:00
parent e687cdcc83
commit 86fb565d4b
4 changed files with 16 additions and 5 deletions

View File

@@ -1,7 +1,9 @@
{
"permissions": {
"allow": [
"Bash(git mv:*)"
"Bash(git mv:*)",
"Bash(./mvnw.cmd dependency:resolve:*)",
"Bash(findstr:*)"
]
}
}

View File

@@ -46,7 +46,7 @@
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
<version>4.3.0</version>
<version>4.5.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@@ -17,6 +17,15 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(requestLogInterceptor)
.addPathPatterns("/**");
.addPathPatterns("/**")
// 排除 Swagger/Knife4j 文档路径
.excludePathPatterns(
"/doc.html",
"/swagger-ui/**",
"/swagger-resources/**",
"/v3/api-docs/**",
"/webjars/**",
"/favicon.ico"
);
}
}

View File

@@ -44,8 +44,8 @@ public class RegisterDto {
private String email;
@NotBlank(message = "密码不能为空")
@Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{8,20}$",
message = "密码必须包含大小写字母和数字长度8-20位")
@Pattern(regexp = "^[a-zA-Z\\d]{8,20}$",
message = "密码只能由字母和数字组成长度8-20位")
@Schema(description = "密码", example = "Password123")
private String pwd;