@waline/vercel 1.31.11 → 1.31.13

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waline/vercel",
3
- "version": "1.31.11",
3
+ "version": "1.31.13",
4
4
  "description": "vercel server for waline comment system",
5
5
  "keywords": [
6
6
  "waline",
@@ -25,7 +25,7 @@
25
25
  "deta": "^2.0.0",
26
26
  "dompurify": "^3.0.8",
27
27
  "dy-node-ip2region": "^1.0.1",
28
- "fast-csv": "^5.0.0",
28
+ "fast-csv": "^5.0.1",
29
29
  "form-data": "^4.0.0",
30
30
  "jsdom": "^24.0.0",
31
31
  "jsonwebtoken": "^9.0.2",
@@ -88,6 +88,8 @@ module.exports = class extends BaseRest {
88
88
  { objectId: ['IN', resp.map(({ objectId }) => objectId)] },
89
89
  );
90
90
 
91
- return this.jsonOrSuccess(deprecated ? ret[0][type] : [ret[0][type]]);
91
+ return this.jsonOrSuccess(
92
+ deprecated ? ret[0][type] : [{ [type]: ret[0][type] }],
93
+ );
92
94
  }
93
95
  };
@@ -26,7 +26,7 @@ module.exports = class extends think.Controller {
26
26
  const waline = init({
27
27
  el: '#waline',
28
28
  path: params.get('path') || '/',
29
- lang: params.get('lng'),
29
+ lang: params.get('lng') || undefined,
30
30
  serverURL: location.protocol + '//' + location.host + location.pathname.replace(/\\/+$/, ''),
31
31
  recaptchaV3Key: '${process.env.RECAPTCHA_V3_KEY || ''}',
32
32
  turnstileKey: '${process.env.TURNSTILE_KEY || ''}',
@@ -209,6 +209,17 @@ module.exports = class extends Base {
209
209
  const { LOGIN } = process.env;
210
210
  const { userInfo } = this.ctx.state;
211
211
 
212
+ this.rules = {
213
+ url: {
214
+ string: true,
215
+ required: true,
216
+ },
217
+ comment: {
218
+ string: true,
219
+ required: true,
220
+ },
221
+ };
222
+
212
223
  if (!think.isEmpty(userInfo)) {
213
224
  return;
214
225
  }