From ef2126f1ca7e9e612ad2df84d32c260ca8ff16ce Mon Sep 17 00:00:00 2001 From: luch1994 <1097650398@qq.com> Date: Fri, 27 Sep 2024 19:10:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=88=B7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF=E5=92=8C=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/.env.development | 19 ++++++++++++++++++- server/package.json | 6 +++--- .../upgrade/services/upgrade.service.ts | 12 ++++++++++-- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/server/.env.development b/server/.env.development index 488910a2..d5d1d565 100644 --- a/server/.env.development +++ b/server/.env.development @@ -1,3 +1,20 @@ -XIAOJU_SURVEY_REPORT=true +XIAOJU_SURVEY_MONGO_DB_NAME=xiaojuSurvey XIAOJU_SURVEY_MONGO_URL=mongodb://127.0.0.1:27017 +XIAOJU_SURVEY_MONGO_AUTH_SOURCE=admin +XIAOJU_SURVEY_REDIS_HOST= +XIAOJU_SURVEY_REDIS_PORT= +XIAOJU_SURVEY_REDIS_USERNAME= +XIAOJU_SURVEY_REDIS_PASSWORD= +XIAOJU_SURVEY_REDIS_DB= + + +XIAOJU_SURVEY_RESPONSE_AES_ENCRYPT_SECRET_KEY=dataAesEncryptSecretKey +XIAOJU_SURVEY_HTTP_DATA_ENCRYPT_TYPE=rsa + +XIAOJU_SURVEY_JWT_SECRET=xiaojuSurveyJwtSecret +XIAOJU_SURVEY_JWT_EXPIRES_IN=8h + +XIAOJU_SURVEY_LOGGER_FILENAME=./logs/app.log + +XIAOJU_SURVEY_REPORT=true diff --git a/server/package.json b/server/package.json index 3ef50f27..27a929ca 100644 --- a/server/package.json +++ b/server/package.json @@ -1,7 +1,7 @@ { - "name": "server", - "version": "0.0.1", - "description": "", + "name": "xiaoju-survey-server", + "version": "1.3.0", + "description": "XIAOJUSURVEY的server端", "author": "", "scripts": { "build": "nest build", diff --git a/server/src/modules/upgrade/services/upgrade.service.ts b/server/src/modules/upgrade/services/upgrade.service.ts index 1eaa21f2..0364932b 100644 --- a/server/src/modules/upgrade/services/upgrade.service.ts +++ b/server/src/modules/upgrade/services/upgrade.service.ts @@ -76,7 +76,7 @@ export class UpgradeService { doc.updatedAt = new Date(doc.updateDate); delete doc.updateDate; } else { - doc.createdAt = new Date(); + doc.updatedAt = new Date(); } } }; @@ -143,7 +143,15 @@ export class UpgradeService { const save = async ({ doc, repository }) => { const entity = repository.create(doc); - await repository.save(entity); + await repository.updateOne( + { + _id: entity._id, + }, + { + $set: entity, + }, + ); + // this.logger.info(JSON.stringify(updateRes)); }; this.logger.info(`upgrading...`); for (const repository of repositories) {