修复登录及验证码功能
This commit is contained in:
@@ -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 进行二次验证
|
||||
|
||||
Reference in New Issue
Block a user