ti2 1.0.55 → 1.0.56
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/auth/authHandler.js +1 -1
- package/index.js +8 -7
- package/package.json +1 -1
package/auth/authHandler.js
CHANGED
package/index.js
CHANGED
|
@@ -15,7 +15,6 @@ const EventEmitter = require('eventemitter2');
|
|
|
15
15
|
|
|
16
16
|
const cacheSettings = {
|
|
17
17
|
'*': [
|
|
18
|
-
'tokenTemplate',
|
|
19
18
|
'getAffiliateAgents',
|
|
20
19
|
'getAffiliateDesks',
|
|
21
20
|
'getPickupPoints',
|
|
@@ -209,12 +208,14 @@ module.exports = async ({
|
|
|
209
208
|
}
|
|
210
209
|
const realSend = res.json;
|
|
211
210
|
res.json = newData => { // new res.json
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
211
|
+
if (res.statusCode === 200) {
|
|
212
|
+
cache.save({
|
|
213
|
+
pluginName: req.pathParams.appKey,
|
|
214
|
+
key: cacheKey,
|
|
215
|
+
value: newData,
|
|
216
|
+
ttl: 60 * 60 * 24, // one day
|
|
217
|
+
});
|
|
218
|
+
}
|
|
218
219
|
// console.log('newData', cacheKey);
|
|
219
220
|
if (!res.headersSent) {
|
|
220
221
|
// console.log('send new data', cacheKey);
|