ls-pro-common 3.1.16 → 3.1.17

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/es/http/index.js CHANGED
@@ -14,7 +14,7 @@ var httpStatus = {
14
14
  503: '请求的服务器异常',
15
15
  504: '请求服务超时'
16
16
  };
17
- var browserId = getCache('browserId') || '';
17
+ var browserId = '';
18
18
  (function () {
19
19
  setTimeout(function () {
20
20
  getBrowserId().then(function (id) {
@@ -58,9 +58,15 @@ request.interceptors.request.use(function (url, options) {
58
58
  // @ts-ignore
59
59
  options.headers.browserId = browserId;
60
60
  } else {
61
- getBrowserId().then(function (id) {
62
- browserId = id;
63
- });
61
+ if (getCache('browserId')) {
62
+ browserId = getCache('browserId');
63
+ // @ts-ignore
64
+ options.headers.browserId = browserId;
65
+ } else {
66
+ getBrowserId().then(function (id) {
67
+ browserId = id;
68
+ });
69
+ }
64
70
  }
65
71
  // 处理门店
66
72
  var shopNo = getCacheSessionFirst('shopNo');
package/lib/http/index.js CHANGED
@@ -14,7 +14,7 @@ var httpStatus = {
14
14
  503: '请求的服务器异常',
15
15
  504: '请求服务超时'
16
16
  };
17
- var browserId = getCache('browserId') || '';
17
+ var browserId = '';
18
18
  (function () {
19
19
  setTimeout(function () {
20
20
  getBrowserId().then(function (id) {
@@ -58,9 +58,15 @@ request.interceptors.request.use(function (url, options) {
58
58
  // @ts-ignore
59
59
  options.headers.browserId = browserId;
60
60
  } else {
61
- getBrowserId().then(function (id) {
62
- browserId = id;
63
- });
61
+ if (getCache('browserId')) {
62
+ browserId = getCache('browserId');
63
+ // @ts-ignore
64
+ options.headers.browserId = browserId;
65
+ } else {
66
+ getBrowserId().then(function (id) {
67
+ browserId = id;
68
+ });
69
+ }
64
70
  }
65
71
  // 处理门店
66
72
  var shopNo = getCacheSessionFirst('shopNo');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "3.1.16",
3
+ "version": "3.1.17",
4
4
  "description": "ls-pro-common",
5
5
  "license": "MIT",
6
6
  "sideEffects": [