支持邮件客户端协议授权码持久加密存储与安全解密查看
This commit is contained in:
1 parent
9fb05c75f2
commit
8c94d07df5
10 files changed
+157
-7
No files matched your search
@@ -33,9 +33,28 @@ const (
|
||||
|
||||
// Service 统一管理密保问题和离线恢复码。
|
||||
type Service struct {
|
||||
engine *xorm.Engine
|
||||
mu sync.Mutex
|
||||
now func() time.Time
|
||||
engine *xorm.Engine
|
||||
mu sync.Mutex
|
||||
now func() time.Time
|
||||
vaultRoot string
|
||||
}
|
||||
|
||||
func (s *Service) SetVaultRoot(root string) {
|
||||
if s == nil {
|
||||
return
|
||||
}
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.vaultRoot = root
|
||||
}
|
||||
|
||||
func (s *Service) VaultRoot() string {
|
||||
if s == nil {
|
||||
return ""
|
||||
}
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
return s.vaultRoot
|
||||
}
|
||||
|
||||
func NewService(engine *xorm.Engine) (*Service, error) {
|
||||
|
||||
Reference in new issue
Block a user