| 123456789101112131415161718192021 |
- package handlers
- import (
- "net/http"
-
- "easydo-echo_win7/services"
- "easydo-echo_win7/utils"
-
- "github.com/labstack/echo/v4"
- )
- // GenerateCaptcha 生成验证码
- func generateCaptcha(c echo.Context) error {
- // 生成验证码
- captcha, err := services.GenerateCaptcha()
- if err != nil {
- return c.JSON(http.StatusInternalServerError, utils.ErrorResponse("生成验证码失败", err.Error()))
- }
-
- return c.JSON(http.StatusOK, captcha)
- }
|