feat: fix stuck error when no captcha provider found (#808)

This commit is contained in:
Resulte Lee
2022-06-21 12:22:46 +08:00
committed by GitHub
parent 2e42511bc4
commit 2c57bece39
3 changed files with 27 additions and 26 deletions

View File

@ -307,13 +307,16 @@ func (c *ApiController) GetCaptcha() {
return
}
if captchaProvider.Type == "Default" {
id, img := object.GetCaptcha()
c.ResponseOk(Captcha{Type: captchaProvider.Type, CaptchaId: id, CaptchaImage: img})
return
} else if captchaProvider.Type != "" {
c.ResponseOk(Captcha{Type: captchaProvider.Type, ClientId: captchaProvider.ClientId, ClientSecret: captchaProvider.ClientSecret})
return
if captchaProvider != nil {
if captchaProvider.Type == "Default" {
id, img := object.GetCaptcha()
c.ResponseOk(Captcha{Type: captchaProvider.Type, CaptchaId: id, CaptchaImage: img})
return
} else if captchaProvider.Type != "" {
c.ResponseOk(Captcha{Type: captchaProvider.Type, ClientId: captchaProvider.ClientId, ClientSecret: captchaProvider.ClientSecret})
return
}
}
c.ResponseOk(Captcha{Type: "none"})
}