diff --git a/internal/infrastructure/http/handlers/captcha_handler.go b/internal/infrastructure/http/handlers/captcha_handler.go index 04d0f27..74c4e02 100644 --- a/internal/infrastructure/http/handlers/captcha_handler.go +++ b/internal/infrastructure/http/handlers/captcha_handler.go @@ -49,6 +49,11 @@ type EncryptedSceneIdReq struct { // @Failure 500 {object} map[string]interface{} "服务器内部错误" // @Router /api/v1/captcha/encryptedSceneId [post] func (h *CaptchaHandler) GetEncryptedSceneId(c *gin.Context) { + if !h.config.SMS.CaptchaEnabled { + h.response.BadRequest(c, "滑块验证码未启用") + return + } + expireSec := 3600 if c.Request.ContentLength > 0 { var req EncryptedSceneIdReq