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

This reverts commit c511a2e6b3.
This commit is contained in:
maxbad
2023-05-15 23:15:17 +08:00
parent c981d0b8eb
commit 64ed43b7ca
30 changed files with 98 additions and 336 deletions

View File

@@ -2,9 +2,11 @@ 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/utility/simple"
"hotgo/internal/consts"
"hotgo/utility/encrypt"
)
// RegisterInp 账号注册
@@ -18,11 +20,18 @@ type RegisterInp struct {
func (in *RegisterInp) Filter(ctx context.Context) (err error) {
// 解密密码
password, err := simple.DecryptText(in.Password)
str, err := gbase64.Decode([]byte(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
}