redis psw

This commit is contained in:
junleea 2024-08-17 14:13:29 +08:00
parent b1fec34718
commit f642aa054f
1 changed files with 3 additions and 3 deletions

View File

@ -17,9 +17,9 @@ func InitRedis() error {
ctx := context.Background() ctx := context.Background()
// 连接redis // 连接redis
redisClient = redis.NewClient(&redis.Options{ redisClient = redis.NewClient(&redis.Options{
Addr: proto.REDIS_ADDR, // Redis 服务器地址 Addr: proto.REDIS_ADDR, // Redis 服务器地址
//Password: proto.REDIS_PASSWORD, // 如果 Redis 设置了密码 Password: proto.REDIS_PASSWORD, // 如果 Redis 设置了密码
DB: proto.REIDS_DB, // 使用的数据库编号 DB: proto.REIDS_DB, // 使用的数据库编号
}) })
// 验证 Redis 客户端是否可以正常工作 // 验证 Redis 客户端是否可以正常工作