From 4e192fe454de644f9d0d835c8b2856409617deef Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Thu, 7 Jul 2022 18:49:31 +0800 Subject: [PATCH] redis pswd --- code/VideoAccess-VCMP/api/app/lib/service/redis.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/VideoAccess-VCMP/api/app/lib/service/redis.js b/code/VideoAccess-VCMP/api/app/lib/service/redis.js index 48810c0..06fae53 100644 --- a/code/VideoAccess-VCMP/api/app/lib/service/redis.js +++ b/code/VideoAccess-VCMP/api/app/lib/service/redis.js @@ -3,10 +3,12 @@ const redis = require("ioredis") module.exports = async function factory (app, opts) { - let client = new redis(opts.redis.port, opts.redis.host); + let client = new redis(opts.redis.port, opts.redis.host, { + password: opts.redis.pwd, + }); client.on("error", function (err) { - app.fs.logger.error('info', '[FS-AUTH-REDIS]', `redis connect error. ${opts.redis.host + ':' + opts.redis.port}` ); + app.fs.logger.error('info', '[FS-AUTH-REDIS]', `redis connect error. ${opts.redis.host + ':' + opts.redis.port}`); // console.error("Error :", err); // process.exit(-1); });