优化服务退出流程,增加中间件文档

This commit is contained in:
孟帅
2023-05-15 18:37:40 +08:00
parent fdefb42253
commit c511a2e6b3
30 changed files with 335 additions and 97 deletions

View File

@@ -2,11 +2,9 @@ package adminin
import (
"context"
"github.com/gogf/gf/v2/encoding/gbase64"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/consts"
"hotgo/utility/encrypt"
"hotgo/utility/simple"
)
// RegisterInp 账号注册
@@ -20,18 +18,11 @@ type RegisterInp struct {
func (in *RegisterInp) Filter(ctx context.Context) (err error) {
// 解密密码
str, err := gbase64.Decode([]byte(in.Password))
password, err := simple.DecryptText(in.Password)
if err != nil {
return err
}
str, err = encrypt.AesECBDecrypt(str, consts.RequestEncryptKey)
if err != nil {
return err
}
password := string(str)
if err = g.Validator().Data(password).Rules("password").Messages("密码长度在6~18之间").Run(ctx); err != nil {
return
}