refactor: 新增base.Repo与base.App,重构repo与app层代码

This commit is contained in:
meilin.huang
2023-10-26 17:15:49 +08:00
parent 10f6b03fb5
commit a1303b52eb
115 changed files with 1867 additions and 1696 deletions

View File

@@ -1,7 +1,6 @@
package captcha
import (
"mayfly-go/pkg/biz"
"mayfly-go/pkg/rediscli"
"time"
@@ -12,7 +11,7 @@ var store base64Captcha.Store
var driver base64Captcha.Driver = base64Captcha.DefaultDriverDigit
// 生成验证码
func Generate() (string, string) {
func Generate() (string, string, error) {
if store == nil {
if rediscli.GetCli() != nil {
store = new(RedisStore)
@@ -23,9 +22,7 @@ func Generate() (string, string) {
c := base64Captcha.NewCaptcha(driver, store)
// 获取
id, b64s, err := c.Generate()
biz.ErrIsNilAppendErr(err, "获取验证码错误: %s")
return id, b64s
return c.Generate()
}
// 验证验证码