mirror of
https://github.com/skyle1995/NetworkAuth.git
synced 2026-05-25 10:42:45 +08:00
修改项目为前后端分离方案
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mojocn/base64Captcha"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// ============================================================================
|
||||
@@ -100,8 +101,10 @@ func VerifyCaptcha(c *gin.Context, captchaValue string) bool {
|
||||
// 从cookie中获取验证码ID
|
||||
captchaId, err := c.Cookie("captcha_id")
|
||||
if err != nil || captchaId == "" {
|
||||
logrus.WithError(err).Warn("验证码验证失败:无法从Cookie获取captcha_id")
|
||||
return false
|
||||
}
|
||||
logrus.Infof("VerifyCaptcha: received captchaId=%s, captchaValue=%s", captchaId, captchaValue)
|
||||
|
||||
// 先尝试原始值验证
|
||||
if store.Verify(captchaId, captchaValue, false) {
|
||||
|
||||
Reference in New Issue
Block a user