修复登录及验证码功能

This commit is contained in:
2026-09-03 10:12:30 +08:00
parent 57d9866dab
commit 7c38e84e30
13 changed files with 309 additions and 118 deletions
+7 -4
View File
@@ -2,7 +2,6 @@ package geetest
import (
"errors"
"photowall/internal/config"
)
// 极验行为验证封装
@@ -10,14 +9,18 @@ import (
var ErrNotConfigured = errors.New("极验未配置,请联系管理员")
type Config struct {
CaptchaID string
CaptchaKey string
}
// Validate 校验极验二次验证结果
// lotNumber: 极验返回的 lot_number
// captchaOutput: 极验返回的 captcha_output
// passToken: 极验返回的 pass_token
// genTime: 极验返回的 gen_time
func Validate(lotNumber, captchaOutput, passToken, genTime string) error {
cfg := config.C
if cfg.GeeTestID == "" || cfg.GeeTestKey == "" {
func Validate(cfg Config, lotNumber, captchaOutput, passToken, genTime string) error {
if cfg.CaptchaID == "" || cfg.CaptchaKey == "" {
return ErrNotConfigured
}
// TODO: 接入极验官方 SDK 进行二次验证