This commit is contained in:
suyl
2021-07-20 15:13:48 +08:00
parent bca946aadc
commit 2b6966f93d
2 changed files with 8 additions and 5 deletions

View File

@@ -34,10 +34,13 @@ func DelKey(key string) error {
return client.Del(key).Err()
}
func GetKey(key string) string {
func GetKey(key string) interface{} {
result, err := client.Get(key).Result()
if err == nil {
return result
var retVal interface{}
if err = utils.UnmarshalUseNumber([]byte(result), &retVal); err == nil {
return retVal
}
}
return ""
return nil
}