From f85b24dd0accc3523fcec1f6a00fd4c87f280dba Mon Sep 17 00:00:00 2001 From: "zhiyong.yue" Date: Thu, 2 Nov 2023 14:12:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0dialogTag,=E4=BE=9B=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E7=A6=81=E7=94=A8=E6=8E=A5=E5=8F=A3=E7=9B=91=E5=90=AC?= =?UTF-8?q?,=E9=81=BF=E5=85=8D=E5=BC=82=E5=B8=B8=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=97=B6=E8=AF=AF=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/apiObserver.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/apiObserver.js b/tools/apiObserver.js index eb83230..63ff37c 100644 --- a/tools/apiObserver.js +++ b/tools/apiObserver.js @@ -2,6 +2,7 @@ "use strict"; const win = window.unsafeWindow || document.defaultView || window; win.maskTag = 1; + win.dialogTag = 1; let mask = document.createElement("div"); mask.style = "position: fixed;top: 0;right: 0;bottom: 0;left: 0;z-index: 1000;height: 100%;background-color: rgba(0,0,0,.0)"; @@ -42,9 +43,9 @@ document.body.appendChild(mask); } request.response = (res) => { - if (res.status === 403){ + if (win.dialogTag && res.status === 403){ win.alert("API:" + res.finalUrl + "-----failInfo:Response status is 403"); - }else if(res.json && res.json.hasOwnProperty("failed")) + }else if(win.dialogTag && res.json && res.json.hasOwnProperty("failed")) { win.alert("API:" + res.finalUrl + "-----failInfo:" + res.json.message); }