mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-30 08:37:12 +08:00
feat: 支持注册 captcha
This commit is contained in:
1 parent
ff1b6288bf
commit
07902303cc
1 file changed
+7
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/chaitin/MonkeyCode/backend/domain"
|
||||
"github.com/chaitin/MonkeyCode/backend/errcode"
|
||||
"github.com/chaitin/MonkeyCode/backend/pkg"
|
||||
"github.com/chaitin/MonkeyCode/backend/pkg/captcha"
|
||||
"github.com/chaitin/MonkeyCode/backend/pkg/tasker"
|
||||
)
|
||||
|
||||
@@ -84,6 +85,12 @@ func WithSiteResolver(resolver domain.SiteResolver) BridgeOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithCaptcha(captcha *captcha.Captcha) BridgeOption {
|
||||
return func(i *do.Injector) {
|
||||
do.OverrideValue(i, captcha)
|
||||
}
|
||||
}
|
||||
|
||||
func Register(e *echo.Echo, dir string, opts ...BridgeOption) error {
|
||||
cfg, err := config.Init(dir)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user