yakuza0 2.23.20-beta.0 → 2.23.21

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": "yakuza0",
3
- "version": "2.23.20-beta.0",
3
+ "version": "2.23.21",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -71,8 +71,17 @@ var _require = require('http-proxy-middleware'),
71
71
 
72
72
  var autoRefreshCapacity = {};
73
73
 
74
- var getCacheKey = function getCacheKey(str) {
75
- return str.split('?')[0];
74
+ var getCacheKey = function getCacheKey(req) {
75
+ var str = "";
76
+ if (req) {
77
+ if (req.url) {
78
+ str += req.url.split('?')[0];
79
+ }
80
+ if (req.headers) {
81
+ str += (0, _server.md5)(req.headers["User-Agent".toLowerCase()]);
82
+ }
83
+ }
84
+ return str;
76
85
  };
77
86
 
78
87
  var spiBody = function spiBody(appConf) {
@@ -321,7 +330,7 @@ exports.default = function () {
321
330
 
322
331
  app.use(function (req, res, next) {
323
332
  if (_config2.default.security.isTire) {
324
- var data = (0, _secCache.secCacheGet)(getCacheKey(req.url));
333
+ var data = (0, _secCache.secCacheGet)(getCacheKey(req));
325
334
 
326
335
  if (data) {
327
336
  var isHasCookie = false;
@@ -346,7 +355,7 @@ exports.default = function () {
346
355
  var isSet = req.get("x-gen-set");
347
356
 
348
357
  if (isSet !== "true") {
349
- var _data = (0, _secCache.secCacheGet)(getCacheKey(req.url));
358
+ var _data = (0, _secCache.secCacheGet)(getCacheKey(req));
350
359
  // res.header("Connection", "close");
351
360
  // console.log(req.url, "all");
352
361
 
@@ -585,7 +594,7 @@ exports.default = function () {
585
594
  body = Buffer.concat(body);
586
595
 
587
596
  if (isTireSave || isLibSave || isFastDfs(req.url)) {
588
- (0, _secCache.secCacheSet)(getCacheKey(req.url), {
597
+ (0, _secCache.secCacheSet)(getCacheKey(req), {
589
598
  body: body,
590
599
  resHeaders: proxyRes.headers,
591
600
  status: res.statusCode