feat: 新增双因素校验(OTP)

This commit is contained in:
meilin.huang
2023-06-17 15:15:03 +08:00
parent b42a98aff5
commit ef4e34c584
23 changed files with 462 additions and 111 deletions

View File

@@ -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
}