fix(middleware): 管理员JWT增加TokenVersion校验

管理员改密后旧JWT会被拒绝,并补充单元测试覆盖。
This commit is contained in:
yangjianbo
2026-02-07 16:28:19 +08:00
parent a9e256ce8c
commit 65c0d8b51f
4 changed files with 203 additions and 3 deletions

View File

@@ -598,7 +598,7 @@ func newContractDeps(t *testing.T) *contractDeps {
usageRepo := newStubUsageLogRepo()
usageService := service.NewUsageService(usageRepo, userRepo, nil, nil)
subscriptionService := service.NewSubscriptionService(groupRepo, userSubRepo, nil)
subscriptionService := service.NewSubscriptionService(groupRepo, userSubRepo, nil, cfg)
subscriptionHandler := handler.NewSubscriptionHandler(subscriptionService)
redeemService := service.NewRedeemService(redeemRepo, userRepo, subscriptionService, nil, nil, nil, nil)