mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 13:03:22 +08:00
优化服务退出流程,增加中间件文档
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user