fix: 缓存使用redis无法set问题修复&admin账号默认有所有菜单

This commit is contained in:
meilin.huang
2023-10-12 21:50:55 +08:00
parent d300f604f1
commit e0f1f40ba0
14 changed files with 35 additions and 245 deletions

View File

@@ -23,8 +23,11 @@ func Get(key string) (string, error) {
}
// set key value
func Set(key string, val string, expiration time.Duration) {
cli.Set(context.TODO(), key, val, expiration)
func Set(key string, val string, expiration time.Duration) error {
if expiration < 0 {
expiration = 0
}
return cli.Set(context.TODO(), key, val, expiration).Err()
}
func Del(key string) {