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

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.309",
3
+ "version": "1.0.0-beta.310",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -64,10 +64,10 @@ function requestInterceptors(config) {
64
64
 
65
65
  // 添加防止重复提交
66
66
  if(process.env.IF_OPEN_NO_REPEAT_SUBMIT && process.env.IF_OPEN_NO_REPEAT_SUBMIT === "true"){
67
- // throttle(config);
68
- if(!config.ignoreCancelToken){
69
- abortController.addPending(config);
70
- }
67
+ throttle(config);
68
+ // if(!config.ignoreCancelToken){
69
+ // abortController.addPending(config);
70
+ // }
71
71
  // if(!config.isNotCancel){
72
72
  // cancelToken.removePending(config)
73
73
  // config = cancelToken.addPending(config)
@@ -31,11 +31,11 @@ export function throttle(config) {
31
31
  const lastData = lastRequestObj.data;
32
32
  const lastTime = lastRequestObj.time;
33
33
  // 间隔时间(ms),小于此时间视为重复提交
34
- const interval = 1000;
34
+ const interval = 10000;
35
35
  if (lastUrl === requestObj.url && lastData === requestObj.data
36
36
  && requestObj.time - lastTime < interval) {
37
37
  const message = '数据正在处理,请勿重复提交';
38
- console.warn(`[${his_url}]: ` + message);
38
+ console.warn(`[${lastUrl}]: ` + message);
39
39
  return Promise.reject(new Error(message));
40
40
  } else {
41
41
  requestObjMap[requestId] = requestObj;