From 0610537a48445b77761565bc67faf969497a69c5 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Thu, 7 Jul 2022 18:49:14 +0800 Subject: [PATCH 1/4] redis pswd --- code/api/app/lib/service/redis.js | 4 +++- code/web/client/index.ejs | 1 + code/web/client/index.html | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/api/app/lib/service/redis.js b/code/api/app/lib/service/redis.js index 91e8458..9097d4b 100644 --- a/code/api/app/lib/service/redis.js +++ b/code/api/app/lib/service/redis.js @@ -3,7 +3,9 @@ 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 = 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 @@ + From ce198c9cf750735bb473ebccb4f97a0844fd01d5 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Thu, 7 Jul 2022 19:44:01 +0800 Subject: [PATCH 2/4] redis.Cluster --- code/api/app/lib/service/redis.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/code/api/app/lib/service/redis.js b/code/api/app/lib/service/redis.js index 9097d4b..67af56a 100644 --- a/code/api/app/lib/service/redis.js +++ b/code/api/app/lib/service/redis.js @@ -3,9 +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, { - password: opts.redis.pwd, - }); + 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.'); From 55700bf7c75bdb1487e26bb4d01cb9bd3ddf5918 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Mon, 1 Aug 2022 16:20:04 +0800 Subject: [PATCH 3/4] -u --- code/web/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/web/package.json b/code/web/package.json index 1578628..fa02815 100644 --- a/code/web/package.json +++ b/code/web/package.json @@ -7,7 +7,7 @@ "test": "mocha", "start-vite": "cross-env NODE_ENV=developmentVite npm run start-params", "start": "cross-env NODE_ENV=development npm run start-params", - "start-params": "node server -p 5200 -u http://10.8.30.7:4200", + "start-params": "node server -p 5200 -u http://10.8.30.29:4200", "deploy": "export NODE_ENV=production&& npm run build && node server", "build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js", "build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js" From 708a7352a5b32c4dd9c6db155561e8cdf4414427 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 2 Aug 2022 09:20:18 +0800 Subject: [PATCH 4/4] -u --- code/web/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/web/package.json b/code/web/package.json index fa02815..c79b2b2 100644 --- a/code/web/package.json +++ b/code/web/package.json @@ -7,7 +7,7 @@ "test": "mocha", "start-vite": "cross-env NODE_ENV=developmentVite npm run start-params", "start": "cross-env NODE_ENV=development npm run start-params", - "start-params": "node server -p 5200 -u http://10.8.30.29:4200", + "start-params": "node server -p 5200 -u http://10.8.30.24:4200", "deploy": "export NODE_ENV=production&& npm run build && node server", "build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js", "build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js"