This commit is contained in:
2026-02-24 18:42:06 +08:00
parent 2d40d589e2
commit d80076e2c7
2 changed files with 8 additions and 38 deletions

View File

@@ -1,14 +1,13 @@
package captcha
import (
"os"
"tyc-server/common/xerr"
captcha20230305 "github.com/alibabacloud-go/captcha-20230305/client"
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
"github.com/alibabacloud-go/tea/tea"
"github.com/pkg/errors"
"github.com/zeromicro/go-zero/core/logx"
"tyc-server/common/xerr"
)
// Config 阿里云验证码配置(与 api internal config 解耦,供 pkg 使用)
@@ -21,9 +20,9 @@ type Config struct {
// Verify 校验前端传入的 captchaVerifyParam。异常时视为通过以保证业务可用。
func Verify(cfg Config, captchaVerifyParam string) error {
if os.Getenv("ENV") == "development" {
return nil
}
// if os.Getenv("ENV") == "development" {
// return nil
// }
if captchaVerifyParam == "" {
return errors.Wrapf(xerr.NewErrMsg("图形验证码校验失败"), "empty captchaVerifyParam")
}