@nocobase/plugin-verification 0.10.0-alpha.2 → 0.10.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -117,6 +117,12 @@ class VerificationPlugin extends _server().Plugin {
117
117
  INIT_ALI_SMS_VERIFY_CODE_SIGN = _process$env.INIT_ALI_SMS_VERIFY_CODE_SIGN;
118
118
  if (DEFAULT_SMS_VERIFY_CODE_PROVIDER && INIT_ALI_SMS_ACCESS_KEY && INIT_ALI_SMS_ACCESS_KEY_SECRET && INIT_ALI_SMS_VERIFY_CODE_TEMPLATE && INIT_ALI_SMS_VERIFY_CODE_SIGN) {
119
119
  const ProviderRepo = _this2.db.getRepository('verifications_providers');
120
+ const existed = yield ProviderRepo.count({
121
+ filterByTk: DEFAULT_SMS_VERIFY_CODE_PROVIDER
122
+ });
123
+ if (existed) {
124
+ return;
125
+ }
120
126
  yield ProviderRepo.create({
121
127
  values: {
122
128
  id: DEFAULT_SMS_VERIFY_CODE_PROVIDER,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "验证码",
5
5
  "description": "verification setting.",
6
6
  "description.zh-CN": "验证码配置。",
7
- "version": "0.10.0-alpha.2",
7
+ "version": "0.10.0-alpha.4",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./lib/index.js",
10
10
  "types": "./lib/index.d.ts",
@@ -12,14 +12,14 @@
12
12
  "@alicloud/dysmsapi20170525": "2.0.17",
13
13
  "@alicloud/openapi-client": "0.4.1",
14
14
  "@alicloud/tea-util": "1.4.4",
15
- "@nocobase/actions": "0.10.0-alpha.2",
16
- "@nocobase/resourcer": "0.10.0-alpha.2",
17
- "@nocobase/server": "0.10.0-alpha.2",
18
- "@nocobase/utils": "0.10.0-alpha.2",
15
+ "@nocobase/actions": "0.10.0-alpha.4",
16
+ "@nocobase/resourcer": "0.10.0-alpha.4",
17
+ "@nocobase/server": "0.10.0-alpha.4",
18
+ "@nocobase/utils": "0.10.0-alpha.4",
19
19
  "tencentcloud-sdk-nodejs": "^4.0.525"
20
20
  },
21
21
  "devDependencies": {
22
- "@nocobase/test": "0.10.0-alpha.2"
22
+ "@nocobase/test": "0.10.0-alpha.4"
23
23
  },
24
- "gitHead": "85028ae1733fcbd46ecd5d291dacbdc175f7f073"
24
+ "gitHead": "62dacadb2a83d30cb36dda9074f2f3a072a37484"
25
25
  }
@@ -98,6 +98,12 @@ export default class VerificationPlugin extends Plugin {
98
98
  INIT_ALI_SMS_VERIFY_CODE_SIGN
99
99
  ) {
100
100
  const ProviderRepo = this.db.getRepository('verifications_providers');
101
+ const existed = await ProviderRepo.count({
102
+ filterByTk: DEFAULT_SMS_VERIFY_CODE_PROVIDER,
103
+ });
104
+ if (existed) {
105
+ return;
106
+ }
101
107
  await ProviderRepo.create({
102
108
  values: {
103
109
  id: DEFAULT_SMS_VERIFY_CODE_PROVIDER,