支持邮件客户端协议授权码持久加密存储与安全解密查看

This commit is contained in:
xuans committed 2026-09-12 14:01:38 +08:00
1 parent 9fb05c75f2
commit 8c94d07df5
10 files changed
+157 -7

No files matched your search

+22 -3
View File
@@ -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) {