fix: 遗漏sql补充

This commit is contained in:
meilin.huang
2023-06-21 15:18:43 +08:00
parent 414de9f2eb
commit 4709edcd1c
8 changed files with 33 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
package entity
import (
"mayfly-go/internal/common/utils"
"mayfly-go/pkg/model"
"time"
)
@@ -26,6 +27,17 @@ func (a *Account) IsEnable() bool {
return a.Status == AccountEnableStatus
}
func (a *Account) OtpSecretEncrypt() {
a.OtpSecret = utils.PwdAesEncrypt(a.OtpSecret)
}
func (a *Account) OtpSecretDecrypt() {
if a.OtpSecret == "-" {
return
}
a.OtpSecret = utils.PwdAesDecrypt(a.OtpSecret)
}
const (
AccountEnableStatus int8 = 1 // 启用状态
AccountDisableStatus int8 = -1 // 禁用状态