diff --git a/code/api/app/lib/service/redis.js b/code/api/app/lib/service/redis.js index 91e8458..67af56a 100644 --- a/code/api/app/lib/service/redis.js +++ b/code/api/app/lib/service/redis.js @@ -3,7 +3,20 @@ const redis = require("ioredis") const moment = require('moment') module.exports = async function factory (app, opts) { - let client = new redis(opts.redis.port, opts.redis.host); + let client = opts.redis.pwd ? + new redis.Cluster([ + { + host: opts.redis.host, + port: opts.redis.port + } + ], { + redisOptions: { + password: opts.redis.pwd, + }, + }) + : 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.'); diff --git a/code/web/client/index.ejs b/code/web/client/index.ejs index be3ad78..036164a 100644 --- a/code/web/client/index.ejs +++ b/code/web/client/index.ejs @@ -4,6 +4,7 @@
+ diff --git a/code/web/client/index.html b/code/web/client/index.html index 053c990..2625b5c 100644 --- a/code/web/client/index.html +++ b/code/web/client/index.html @@ -4,6 +4,7 @@ +