node-easywechat 3.5.0 → 3.5.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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/Core/HttpClient/HttpClientResponse.d.ts +1 -1
- package/dist/MiniApp/AccessToken.d.ts +2 -3
- package/dist/MiniApp/AccessToken.js +6 -9
- package/dist/OfficialAccount/AccessToken.d.ts +4 -0
- package/dist/OfficialAccount/AccessToken.js +5 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ declare class HttpClientResponse implements HttpClientResponseInterface {
|
|
|
86
86
|
getHeaders(throwError?: boolean): Record<string, any>;
|
|
87
87
|
getContent(throwError?: boolean): any;
|
|
88
88
|
cancel(): void;
|
|
89
|
-
getInfo(type?: string): import("axios").
|
|
89
|
+
getInfo(type?: string): import("axios").InternalAxiosRequestConfig<any>;
|
|
90
90
|
offsetExists(key: any): Promise<boolean>;
|
|
91
91
|
offsetGet(key: any): Promise<any>;
|
|
92
92
|
}
|
|
@@ -4,15 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
const AccessToken_1 = __importDefault(require("../OfficialAccount/AccessToken"));
|
|
6
6
|
class AccessToken extends AccessToken_1.default {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this.key = `mini_app.access_token.${this.appId}`;
|
|
14
|
-
}
|
|
15
|
-
return this.key;
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
/**
|
|
10
|
+
* 缓存前缀
|
|
11
|
+
*/
|
|
12
|
+
this.CACHE_KEY_PREFIX = 'mini_app';
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
15
|
module.exports = AccessToken;
|
|
@@ -8,6 +8,10 @@ declare class AccessToken implements RefreshableAccessTokenInterface {
|
|
|
8
8
|
protected cache: CacheInterface;
|
|
9
9
|
protected httpClient: HttpClientInterface;
|
|
10
10
|
protected stable: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 缓存前缀
|
|
13
|
+
*/
|
|
14
|
+
protected CACHE_KEY_PREFIX: string;
|
|
11
15
|
constructor(appId: string, secret: string, key?: string, cache?: CacheInterface, httpClient?: HttpClientInterface, stable?: boolean);
|
|
12
16
|
/**
|
|
13
17
|
* 获取access_token的缓存名称
|
|
@@ -20,6 +20,10 @@ class AccessToken {
|
|
|
20
20
|
this.cache = cache;
|
|
21
21
|
this.httpClient = httpClient;
|
|
22
22
|
this.stable = stable;
|
|
23
|
+
/**
|
|
24
|
+
* 缓存前缀
|
|
25
|
+
*/
|
|
26
|
+
this.CACHE_KEY_PREFIX = 'official_account';
|
|
23
27
|
if (!this.httpClient) {
|
|
24
28
|
this.httpClient = HttpClient_1.default.create({
|
|
25
29
|
baseURL: 'https://api.weixin.qq.com/',
|
|
@@ -32,7 +36,7 @@ class AccessToken {
|
|
|
32
36
|
*/
|
|
33
37
|
getKey() {
|
|
34
38
|
if (!this.key) {
|
|
35
|
-
this.key =
|
|
39
|
+
this.key = `${this.CACHE_KEY_PREFIX}.access_token.${this.appId}`;
|
|
36
40
|
}
|
|
37
41
|
return this.key;
|
|
38
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-easywechat",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"description": "EasyWechat SDK for Node.js (NOT OFFICIAL)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"typescript": "^4.6.3"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"axios": "^
|
|
33
|
-
"axios-retry": "^3.
|
|
32
|
+
"axios": "^1.6.1",
|
|
33
|
+
"axios-retry": "^3.8.1",
|
|
34
34
|
"form-data": "^4.0.0",
|
|
35
35
|
"merge": "^2.1.1",
|
|
36
|
-
"node-socialite": "^1.
|
|
37
|
-
"qs": "^6.
|
|
38
|
-
"raw-body": "^2.5.
|
|
39
|
-
"xml2js": "^0.
|
|
36
|
+
"node-socialite": "^1.4.1",
|
|
37
|
+
"qs": "^6.11.2",
|
|
38
|
+
"raw-body": "^2.5.2",
|
|
39
|
+
"xml2js": "^0.6.2"
|
|
40
40
|
}
|
|
41
41
|
}
|