@lambo-design/shared 1.0.0-beta.307 → 1.0.0-beta.309

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": "@lambo-design/shared",
3
- "version": "1.0.0-beta.307",
3
+ "version": "1.0.0-beta.309",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -5,6 +5,7 @@ import Bus from '../bus';
5
5
  import headers from './headers';
6
6
  import {throttle} from "./throttle";
7
7
  import abortController from "./abort-controller"
8
+ import cancelToken from "./cancel-token"
8
9
  let timer1, timer2;
9
10
  let hasDialog = false;
10
11
 
@@ -64,10 +65,13 @@ function requestInterceptors(config) {
64
65
  // 添加防止重复提交
65
66
  if(process.env.IF_OPEN_NO_REPEAT_SUBMIT && process.env.IF_OPEN_NO_REPEAT_SUBMIT === "true"){
66
67
  // throttle(config);
67
- const ignoreCancelToken = config.ignoreCancelToken ?? true;
68
- if(!ignoreCancelToken){
68
+ if(!config.ignoreCancelToken){
69
69
  abortController.addPending(config);
70
70
  }
71
+ // if(!config.isNotCancel){
72
+ // cancelToken.removePending(config)
73
+ // config = cancelToken.addPending(config)
74
+ // }
71
75
  }
72
76
 
73
77
 
@@ -3,7 +3,7 @@ const requestObjMap = {};
3
3
  const getPendingUrl = (config) => {
4
4
  const { url, method, data, headers } = config;
5
5
  // 生成请求唯一标识
6
- return [url, method].join('&');
6
+ return [url, method, JSON.stringify(data), JSON.stringify(headers)].join('&');
7
7
  };
8
8
  /**
9
9
  * 防止重复提交