@lark-apaas/client-toolkit 1.2.28-alpha.3 → 1.2.28-alpha.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.
@@ -139,7 +139,8 @@ class ApiProxy {
139
139
  ...config,
140
140
  headers: {
141
141
  ...this.defaultConfig.headers,
142
- ...config.headers
142
+ ...config.headers,
143
+ 'X-Page-Route': 'undefined' != typeof window ? window.location?.pathname || '/' : '/'
143
144
  }
144
145
  };
145
146
  const requestKey = this.generateRequestKey(mergedConfig);
@@ -344,6 +344,7 @@ function initAxiosConfig(axiosInstance) {
344
344
  config._startTime = config._startTime || Date.now();
345
345
  const csrfToken = window.csrfToken;
346
346
  if (csrfToken) config.headers['X-Suda-Csrf-Token'] = csrfToken;
347
+ if ('undefined' != typeof window && window.location?.pathname) config.headers['X-Page-Route'] = window.location.pathname;
347
348
  const refererPath = getRefererPath();
348
349
  config.headers['Rpc-Persist-Apaas-Observability-Referer-Path'] = refererPath;
349
350
  const reqMethod = (config.method || 'GET').toUpperCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.2.28-alpha.3",
3
+ "version": "1.2.28-alpha.5",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [