@waline/vercel 1.30.3 → 1.30.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waline/vercel",
3
- "version": "1.30.3",
3
+ "version": "1.30.4",
4
4
  "description": "vercel server for waline comment system",
5
5
  "keywords": [
6
6
  "waline",
@@ -4,6 +4,8 @@ const Mongo = require('think-mongo');
4
4
 
5
5
  const { isNetlify, netlifyFunctionPrefix } = require('./netlify');
6
6
 
7
+ const isDeta = think.env === 'deta' || process.env.DETA_RUNTIME === 'true';
8
+
7
9
  module.exports = [
8
10
  Model(think.app),
9
11
  Mongo(think.app),
@@ -22,6 +24,10 @@ module.exports = [
22
24
  return `${protocol}://${host}${netlifyFunctionPrefix}`;
23
25
  }
24
26
 
27
+ if (isDeta) {
28
+ return `https://${host}`;
29
+ }
30
+
25
31
  return `${protocol}://${host}`;
26
32
  },
27
33
  async webhook(type, data) {
@@ -493,7 +493,7 @@ module.exports = class extends BaseRest {
493
493
  user_id: this.ctx.state.userInfo.objectId,
494
494
  };
495
495
 
496
- if (pid && this.ctx.deprecated) {
496
+ if (pid && this.ctx.state.deprecated) {
497
497
  data.comment = `[@${at}](#${pid}): ` + data.comment;
498
498
  }
499
499