node-easywechat 3.5.4 → 3.5.5

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/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v3.5.5 (2023-12-02)
5
+
6
+ - Fix: 修复获取服务端实例时,没有获取到最新请求实例的问题 (#47)
7
+
4
8
  ## v3.5.4 (2023-11-15)
5
9
 
6
10
  - Fix: 修复生成支付参数中,时间戳类型错误 (#45)
@@ -2,6 +2,7 @@ import ResponseInterface from "../Http/Contracts/ResponseInterface";
2
2
  import DecryptXmlMessageMixin from "../Mixins/DecryptXmlMessageMixin";
3
3
  import HandlersMixin from "../Mixins/HandlersMixin";
4
4
  import ResponseXmlMessageMixin from "../Mixins/ResponseXmlMessageMixin";
5
+ import ServerRequestMixin from "../Mixins/ServerRequestMixin";
5
6
  declare abstract class ServerInterface {
6
7
  constructor();
7
8
  /**
@@ -9,6 +10,6 @@ declare abstract class ServerInterface {
9
10
  */
10
11
  serve(): Promise<ResponseInterface>;
11
12
  }
12
- interface ServerInterface extends HandlersMixin, DecryptXmlMessageMixin, ResponseXmlMessageMixin {
13
+ interface ServerInterface extends HandlersMixin, DecryptXmlMessageMixin, ResponseXmlMessageMixin, ServerRequestMixin {
13
14
  }
14
15
  export = ServerInterface;
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  const DecryptXmlMessageMixin_1 = __importDefault(require("../Mixins/DecryptXmlMessageMixin"));
15
15
  const HandlersMixin_1 = __importDefault(require("../Mixins/HandlersMixin"));
16
16
  const ResponseXmlMessageMixin_1 = __importDefault(require("../Mixins/ResponseXmlMessageMixin"));
17
+ const ServerRequestMixin_1 = __importDefault(require("../Mixins/ServerRequestMixin"));
17
18
  const Utils_1 = require("../Support/Utils");
18
19
  class ServerInterface {
19
20
  constructor() {
@@ -28,5 +29,5 @@ class ServerInterface {
28
29
  }
29
30
  ;
30
31
  ;
31
- (0, Utils_1.applyMixins)(ServerInterface, [HandlersMixin_1.default, DecryptXmlMessageMixin_1.default, ResponseXmlMessageMixin_1.default]);
32
+ (0, Utils_1.applyMixins)(ServerInterface, [HandlersMixin_1.default, DecryptXmlMessageMixin_1.default, ResponseXmlMessageMixin_1.default, ServerRequestMixin_1.default]);
32
33
  module.exports = ServerInterface;
@@ -77,6 +77,9 @@ class Application {
77
77
  }
78
78
  this.server = new Server_1.default(this.getRequest(), this.getAccount().getAesKey() ? this.getEncryptor() : null);
79
79
  }
80
+ else {
81
+ this.server.setRequest(this.getRequest());
82
+ }
80
83
  return this.server;
81
84
  }
82
85
  /**
@@ -77,6 +77,9 @@ class Application {
77
77
  if (!this.server) {
78
78
  this.server = new Server_1.default(this.getRequest(), this.getAccount().getAesKey() ? this.getEncryptor() : null);
79
79
  }
80
+ else {
81
+ this.server.setRequest(this.getRequest());
82
+ }
80
83
  return this.server;
81
84
  }
82
85
  /**
@@ -98,6 +98,9 @@ class Application {
98
98
  if (!this.server) {
99
99
  this.server = new Server_1.default(this.getAccount().getAesKey() ? this.getEncryptor() : null, this.getRequest());
100
100
  }
101
+ else {
102
+ this.server.setRequest(this.getRequest());
103
+ }
101
104
  return this.server;
102
105
  }
103
106
  /**
@@ -117,6 +117,9 @@ class Application {
117
117
  return next(message);
118
118
  }));
119
119
  }
120
+ else {
121
+ this.server.setRequest(this.getRequest());
122
+ }
120
123
  return this.server;
121
124
  }
122
125
  /**
@@ -49,6 +49,9 @@ class Application {
49
49
  if (!this.server) {
50
50
  this.server = new Server_1.default(this.getMerchant(), this.getRequest());
51
51
  }
52
+ else {
53
+ this.server.setRequest(this.getRequest());
54
+ }
52
55
  return this.server;
53
56
  }
54
57
  /**
@@ -85,6 +85,9 @@ class Application {
85
85
  if (!this.server) {
86
86
  this.server = new Server_1.default(this.getEncryptor(), this.getRequest());
87
87
  }
88
+ else {
89
+ this.server.setRequest(this.getRequest());
90
+ }
88
91
  return this.server;
89
92
  }
90
93
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-easywechat",
3
- "version": "3.5.4",
3
+ "version": "3.5.5",
4
4
  "description": "EasyWechat SDK for Node.js (NOT OFFICIAL)",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {