Merge pull request #176 from Yazzyk/v2.0

处理了 2 个漏洞,并增加验证码方式选择
This commit is contained in:
孟帅
2025-07-01 00:07:53 +08:00
committed by GitHub
10 changed files with 85 additions and 73 deletions

View File

@@ -95,7 +95,11 @@ func (c *cSite) LoginConfig(ctx context.Context, _ *common.SiteLoginConfigReq) (
// Captcha 登录验证码
func (c *cSite) Captcha(ctx context.Context, _ *common.LoginCaptchaReq) (res *common.LoginCaptchaRes, err error) {
cid, base64 := captcha.Generate(ctx)
loginConf, err := service.SysConfig().GetLogin(ctx)
if err != nil {
return
}
cid, base64 := captcha.Generate(ctx, loginConf.CaptchaType)
res = &common.LoginCaptchaRes{Cid: cid, Base64: base64}
return
}