-
Tasks 8-10: authSlice setCredentials/clearCredentials, LoginPage 品牌选择 + 登录表单, 4/4 Vitest 测试通过(authSlice.test.ts + LoginPage.test.tsx)
-
- SecurityConfig: STATELESS, permitAll /api/auth/**, JWT filter - JwtAuthenticationFilter: Bearer token → SecurityContext - AuthController: POST /login, POST /refresh, GET /brands - BrandVO: @JsonProperty to fix Jackson serialization of sNo/sName - AuthControllerTest: 4/4 PASS; all 22 backend tests GREEN
-
- LoginReqDTO/RefreshTokenReqDTO/LoginVO/BrandVO DTO/VO - AuthService interface: login/refresh/getBrands - AuthServiceImpl: multi-tenant brand query, BCrypt, disabled/lock check, fail count (5x → lock 30min), success reset; refresh token validate + re-issue; getBrands ORDER BY sName - UpdateWrapper (string columns) avoids LambdaWrapper unit test issue - BeanConfig: @Bean BCryptPasswordEncoder - AuthServiceTest: 10/10 PASS (7 login + 3 refresh/brands)
-
- BrandEntity/UsrUserEntity: @TableName + @TableField (map-underscore-to-camel-case=false) - BrandMapper/UsrUserMapper: extends BaseMapper - MyBatisPlusConfig: @MapperScan + PaginationInnerInterceptor - BrandMapperTest: insert/query/delete against test DB PASS
-
- JwtProperties: @ConfigurationProperties("jwt") with secret/expiry - JwtUtil: generateAccessToken/generateRefreshToken/parseAccessToken/parseRefreshToken - parseRefreshToken validates type=refresh claim, throws 40103 if mismatch - JwtUtilTest: 3 tests PASS -
- Result<T>: ok()/fail() with code/message/data/timestamp - BizException: carries int code - AuthErrorCode: 40100/40101/40102/40103 constants - GlobalExceptionHandler: BizException, validation, fallback 99000
-
- pom.xml: Spring Boot 3.3.5, MyBatis-Plus 3.5.7, JJWT 0.12.6, Flyway 10.x - application.yml: DB/JWT from env vars, Flyway baseline-on-migrate=true - V1 migration copied to classpath:db/migration - ApplicationContextTest: @SpringBootTest context loads + Flyway baseline OK