mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-03-22 01:45:39 +08:00
feat: 新增双因素校验(OTP)
This commit is contained in:
8
server/pkg/cache/timed_cache.go
vendored
8
server/pkg/cache/timed_cache.go
vendored
@@ -63,10 +63,10 @@ type timedcache struct {
|
||||
func (c *timedcache) Add(k any, x any, d time.Duration) error {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
_, found := c.get(k)
|
||||
if found {
|
||||
return fmt.Errorf("Item %s already exists", k)
|
||||
}
|
||||
// _, found := c.get(k)
|
||||
// if found {
|
||||
// return fmt.Errorf("Item %s already exists", k)
|
||||
// }
|
||||
c.set(k, x, d)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user