修复微信登录ak本地缓存刷新问题

This commit is contained in:
孟帅
2023-06-13 15:45:30 +08:00
parent e6abfbcacf
commit a232986311
15 changed files with 406 additions and 388 deletions

View File

@@ -209,8 +209,8 @@ func (c *AdapterFile) read(key string) (*fileContent, error) {
// Has checks if the cached key exists into the File storage
func (c *AdapterFile) Has(key string) bool {
_, err := c.read(key)
return err == nil
fc, err := c.read(key)
return err == nil && fc != nil
}
// Delete the cached key from File storage
@@ -237,11 +237,11 @@ func (c *AdapterFile) DeleteMulti(keys ...string) (err error) {
func (c *AdapterFile) Fetch(key string) (interface{}, error) {
content, err := c.read(key)
if err != nil {
return "", err
return nil, err
}
if content == nil {
return "", nil
return nil, nil
}
return content.Data, nil