@waline/vercel 1.23.0 → 1.23.2

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.23.0",
3
+ "version": "1.23.2",
4
4
  "description": "vercel server for waline comment system",
5
5
  "keywords": [
6
6
  "waline",
@@ -78,7 +78,10 @@ module.exports = class extends BaseRest {
78
78
 
79
79
  const ret = await this.modelInstance.update(
80
80
  (counter) => ({
81
- [type]: action === 'desc' ? counter[type] - 1 : counter[type] + 1,
81
+ [type]:
82
+ action === 'desc'
83
+ ? (counter[type] || 1) - 1
84
+ : (counter[type] || 0) + 1,
82
85
  }),
83
86
  { objectId: ['IN', resp.map(({ objectId }) => objectId)] }
84
87
  );
@@ -28,7 +28,7 @@ module.exports = class extends think.Controller {
28
28
  return this.redirect(
29
29
  `${oauthUrl}/${type}?${new URLSearchParams({
30
30
  redirect: redirectUrl,
31
- state: this.ctx.state.token,
31
+ state: this.ctx.state.token || '',
32
32
  }).toString()}`
33
33
  );
34
34
  }