@waline/vercel 1.34.1 → 1.34.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.34.1",
3
+ "version": "1.34.2",
4
4
  "description": "vercel server for waline comment system",
5
5
  "keywords": [
6
6
  "waline",
@@ -5,10 +5,10 @@ const nodemailer = require('nodemailer');
5
5
  const nunjucks = require('nunjucks');
6
6
 
7
7
  module.exports = class extends think.Service {
8
- constructor(ctx) {
9
- super(ctx);
8
+ constructor(controller) {
9
+ super(controller);
10
10
 
11
- this.ctx = ctx;
11
+ this.controller = controller;
12
12
  const {
13
13
  SMTP_USER,
14
14
  SMTP_PASS,
@@ -55,8 +55,8 @@ module.exports = class extends think.Service {
55
55
  },
56
56
  };
57
57
 
58
- title = this.ctx.locale(title, data);
59
- content = this.ctx.locale(content, data);
58
+ title = this.controller.locale(title, data);
59
+ content = this.controller.locale(content, data);
60
60
 
61
61
  return this.transporter.sendMail({
62
62
  from:
@@ -94,8 +94,8 @@ module.exports = class extends think.Service {
94
94
  【内容】:{{self.comment}}
95
95
  【地址】:{{site.postUrl}}`;
96
96
 
97
- title = this.ctx.locale(title, data);
98
- content = this.ctx.locale(contentWechat, data);
97
+ title = this.controller.locale(title, data);
98
+ content = this.controller.locale(contentWechat, data);
99
99
 
100
100
  const form = new FormData();
101
101
 
@@ -145,8 +145,8 @@ module.exports = class extends think.Service {
145
145
  【内容】:{{self.comment}}
146
146
  <a href='{{site.postUrl}}'>查看详情</a>`;
147
147
 
148
- title = this.ctx.locale(title, data);
149
- const desp = this.ctx.locale(contentWechat, data);
148
+ title = this.controller.locale(title, data);
149
+ const desp = this.controller.locale(contentWechat, data);
150
150
 
151
151
  content = desp.replace(/\n/g, '<br/>');
152
152
 
@@ -235,7 +235,7 @@ module.exports = class extends think.Service {
235
235
 
236
236
  const form = new FormData();
237
237
 
238
- form.append('msg', this.ctx.locale(contentQQ, data));
238
+ form.append('msg', this.controller.locale(contentQQ, data));
239
239
  form.append('qq', QQ_ID);
240
240
 
241
241
  const qmsgHost = QMSG_HOST
@@ -308,7 +308,7 @@ module.exports = class extends think.Service {
308
308
 
309
309
  const form = new FormData();
310
310
 
311
- form.append('text', this.ctx.locale(contentTG, data));
311
+ form.append('text', this.controller.locale(contentTG, data));
312
312
  form.append('chat_id', TG_CHAT_ID);
313
313
  form.append('parse_mode', 'MarkdownV2');
314
314
 
@@ -352,8 +352,8 @@ module.exports = class extends think.Service {
352
352
  },
353
353
  };
354
354
 
355
- title = this.ctx.locale(title, data);
356
- content = this.ctx.locale(content, data);
355
+ title = this.controller.locale(title, data);
356
+ content = this.controller.locale(content, data);
357
357
 
358
358
  const form = new FormData();
359
359
 
@@ -389,8 +389,8 @@ module.exports = class extends think.Service {
389
389
  },
390
390
  };
391
391
 
392
- title = this.ctx.locale(title, data);
393
- content = this.ctx.locale(
392
+ title = this.controller.locale(title, data);
393
+ content = this.controller.locale(
394
394
  think.config('DiscordTemplate') ||
395
395
  `💬 {{site.name|safe}} 有新评论啦
396
396
  【评论者昵称】:{{self.nick}}
@@ -440,7 +440,7 @@ module.exports = class extends think.Service {
440
440
 
441
441
  const post = {
442
442
  en_us: {
443
- title: this.ctx.locale(title, data),
443
+ title: this.controller.locale(title, data),
444
444
  content: [
445
445
  [
446
446
  {
@@ -532,7 +532,7 @@ module.exports = class extends think.Service {
532
532
  }
533
533
  }
534
534
 
535
- const disallowList = this.ctx.state.oauthServices.map(
535
+ const disallowList = this.controller.ctx.state.oauthServices.map(
536
536
  ({ name }) => 'mail.' + name,
537
537
  );
538
538
  const fakeMail = new RegExp(`@(${disallowList.join('|')})$`, 'i');