From b7219418544c2f3aa6ddb090824fedc50d0a261b Mon Sep 17 00:00:00 2001 From: chaos0156 <429018715@qq.com> Date: Tue, 16 Aug 2022 15:53:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?KERNEL-12408:base=E4=B8=ADeslint=E7=9A=84?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc | 3 ++- src/base/single/input/file.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.eslintrc b/.eslintrc index 3fbfc3524..3269a3eae 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,7 +14,8 @@ "Fix": true, "module": true, "Demo": true, - "_global": true + "_global": true, + "ActiveXObject": true }, "parser": "@typescript-eslint/parser", "parserOptions": { diff --git a/src/base/single/input/file.js b/src/base/single/input/file.js index 4ea51047e..570526f36 100644 --- a/src/base/single/input/file.js +++ b/src/base/single/input/file.js @@ -251,7 +251,7 @@ } else { // Internet Explorer, Opera, others sendFile = function (handler, maxSize, width, height) { - var current = handler.current; + var current = handler.current, iframe, form; var url = handler.url.concat(-1 === handler.url.indexOf("?") ? "?" : "&", "AjaxUploadFrame=true"), rpe = { loaded: 1, total: 100, simulation: true, interval: setInterval(function () { @@ -499,9 +499,9 @@ if (this.file.fileSize !== -1) { // simulation property indicates when the progress event is fake if (rpe.simulation) { - + // empty } else { - + // empty } } else { // if fileSIze is -1 browser is using an iframe because it does From 3755aca7b4a8866ed9b7e77e6c787a5ca10cd40c Mon Sep 17 00:00:00 2001 From: chaos0156 <429018715@qq.com> Date: Tue, 16 Aug 2022 16:40:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?KERNEL-12408:base=E4=B8=ADeslint=E7=9A=84?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc | 3 +-- src/base/single/input/file.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index 3269a3eae..3fbfc3524 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,8 +14,7 @@ "Fix": true, "module": true, "Demo": true, - "_global": true, - "ActiveXObject": true + "_global": true }, "parser": "@typescript-eslint/parser", "parserOptions": { diff --git a/src/base/single/input/file.js b/src/base/single/input/file.js index 570526f36..867756a7c 100644 --- a/src/base/single/input/file.js +++ b/src/base/single/input/file.js @@ -88,7 +88,7 @@ var split = "onabort.onerror.onloadstart.onprogress".split("."), length = split.length, CRLF = "\r\n", - xhr = XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP"), + xhr = new XMLHttpRequest, sendFile; function multipart(boundary, name, file) { return "--".concat(