Skip to content

Commit

Permalink
Update captcha.go
Browse files Browse the repository at this point in the history
  • Loading branch information
admpub authored Jan 9, 2024
1 parent fd8400c commit 7aae104
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion application/library/common/captcha.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ func GetCaptchaEngine(ctx echo.Context, types ...string) (captcha.ICaptcha, erro
}
create := captcha.Get(typ)
if create == nil {
return nil, ctx.NewError(code.Unsupported, `不支持验证码类型: %s`, typ)
if typ != captcha.TypeDefault {
create = captcha.Get(captcha.TypeDefault)
if create == nil {
return nil, ctx.NewError(code.Unsupported, `不支持验证码类型: %s`, typ)
}
} else {
return nil, ctx.NewError(code.Unsupported, `不支持验证码类型: %s`, typ)
}
}
cpt := create()
tcfg := cfg.Children(typ)
Expand Down

0 comments on commit 7aae104

Please sign in to comment.