feat ✨ 验证码store支持go-admin cache
This commit is contained in:
1 parent
e034e5b1ea
commit
eddfe26308
5 files changed
+12
-6
No files matched your search
+5
-1
@@ -3,6 +3,8 @@ package api
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/go-admin-team/go-admin-core/tools/captcha"
|
||||
"go-admin/common/middleware/handler"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -71,6 +73,8 @@ func setup() {
|
||||
log.Fatalf("cache setup error, %s\n", err.Error())
|
||||
}
|
||||
sdk.Runtime.SetCacheAdapter(cacheAdapter)
|
||||
//5. 设置验证码store
|
||||
handler.SetStore(captcha.NewCacheStore(cacheAdapter, 600))
|
||||
|
||||
usageStr := `starting api server...`
|
||||
log.Println(usageStr)
|
||||
@@ -150,4 +154,4 @@ func run() error {
|
||||
func tip() {
|
||||
usageStr := `欢迎使用 ` + pkg.Green(`go-admin `+global.Version) + ` 可以使用 ` + pkg.Red(`-h`) + ` 查看命令`
|
||||
fmt.Printf("%s \n\n", usageStr)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user