tkserver 1.7.5 → 1.7.7

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.
Files changed (3) hide show
  1. package/index.js +7 -0
  2. package/mongo.js +7 -0
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -777,11 +777,18 @@ async function checkCaptcha (comment, request) {
777
777
  geeTestGenTime: comment.geeTestGenTime
778
778
  })
779
779
  } else if (provider === 'Cap' && config.CAP_API_ENDPOINT && config.CAP_SECRET_KEY) {
780
+ if (!comment.capToken) {
781
+ throw new Error('验证码 token 缺失,请刷新页面重试')
782
+ }
780
783
  await checkCapCaptcha({
781
784
  capToken: comment.capToken,
782
785
  capSecretKey: config.CAP_SECRET_KEY,
783
786
  capApiEndpoint: config.CAP_API_ENDPOINT
784
787
  })
788
+ } else if (provider === 'Cap') {
789
+ throw new Error('Cap 验证码配置不完整,请联系管理员')
790
+ } else if (provider) {
791
+ throw new Error(`不支持的验证码类型: ${provider}`)
785
792
  }
786
793
  }
787
794
 
package/mongo.js CHANGED
@@ -754,11 +754,18 @@ async function checkCaptcha (comment, request) {
754
754
  geeTestGenTime: comment.geeTestGenTime
755
755
  })
756
756
  } else if (provider === 'Cap' && config.CAP_API_ENDPOINT && config.CAP_SECRET_KEY) {
757
+ if (!comment.capToken) {
758
+ throw new Error('验证码 token 缺失,请刷新页面重试')
759
+ }
757
760
  await checkCapCaptcha({
758
761
  capToken: comment.capToken,
759
762
  capSecretKey: config.CAP_SECRET_KEY,
760
763
  capApiEndpoint: config.CAP_API_ENDPOINT
761
764
  })
765
+ } else if (provider === 'Cap') {
766
+ throw new Error('Cap 验证码配置不完整,请联系管理员')
767
+ } else if (provider) {
768
+ throw new Error(`不支持的验证码类型: ${provider}`)
762
769
  }
763
770
  }
764
771
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tkserver",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "description": "A simple comment system.",
5
5
  "keywords": [
6
6
  "twikoo",
@@ -31,7 +31,7 @@
31
31
  "get-user-ip": "^1.0.1",
32
32
  "lokijs": "^1.5.12",
33
33
  "mongodb": "^6.3.0",
34
- "twikoo-func": "1.7.5",
34
+ "twikoo-func": "1.7.7",
35
35
  "uuid": "^8.3.2"
36
36
  }
37
37
  }