From 6254fceb049b89f08bb8af4771f907072a87037d Mon Sep 17 00:00:00 2001 From: Junyi Date: Wed, 21 Jun 2023 20:59:19 +0700 Subject: [PATCH] fix(plugin-verification): fix duplication of installation (#2097) --- packages/plugins/verification/src/server/Plugin.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/plugins/verification/src/server/Plugin.ts b/packages/plugins/verification/src/server/Plugin.ts index 503a53754..512d456b8 100644 --- a/packages/plugins/verification/src/server/Plugin.ts +++ b/packages/plugins/verification/src/server/Plugin.ts @@ -98,6 +98,12 @@ export default class VerificationPlugin extends Plugin { INIT_ALI_SMS_VERIFY_CODE_SIGN ) { const ProviderRepo = this.db.getRepository('verifications_providers'); + const existed = await ProviderRepo.count({ + filterByTk: DEFAULT_SMS_VERIFY_CODE_PROVIDER, + }); + if (existed) { + return; + } await ProviderRepo.create({ values: { id: DEFAULT_SMS_VERIFY_CODE_PROVIDER,