add security headers

This commit is contained in:
landaiqing
2024-09-08 15:29:08 +08:00
parent c61c33880c
commit a60739d56d
15 changed files with 72 additions and 55 deletions

View File

@@ -9,4 +9,5 @@ const (
UserLoginClientRedisKey = "user:login:client:"
UserLoginQrcodeRedisKey = "user:login:qrcode:"
UserLoginWechatRedisKey = "user:wechat:token:"
SystemApiNonceRedisKey = "system:api:nonce:"
)

View File

@@ -16,6 +16,11 @@ func Set(key string, value interface{}, expiration time.Duration) *redis.StatusC
return global.REDIS.Set(ctx, key, value, expiration)
}
// Exists 判断名称为key的key是否存在
func Exists(key string) *redis.IntCmd {
return global.REDIS.Exists(ctx, key)
}
// Get 查询数据库中名称为key的value值
func Get(key string) *redis.StringCmd {
return global.REDIS.Get(ctx, key)