From 597819af99af5ffe1ff33cf8fc33bd3e4828eeac Mon Sep 17 00:00:00 2001 From: woohoo Date: Sun, 10 Jul 2022 21:07:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +++- wuhu-torn-helper.js | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3c946cf..d5d349b 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ }, "scripts": { "release": "npm run minify && node build.js", - "minify": "uglifyjs wuhu-torn-helper.js -o release.min.user.js -m" + "minify": "uglifyjs wuhu-torn-helper.js -o release.min.user.js -m", + "serve": "", + "build": "" } } diff --git a/wuhu-torn-helper.js b/wuhu-torn-helper.js index 5b456b4..5c90431 100644 --- a/wuhu-torn-helper.js +++ b/wuhu-torn-helper.js @@ -10265,9 +10265,14 @@ z-index:100001; }); }); }; - WHNotify(await backHomeAction()); - WHNotify('成功,即将刷新页面……'); - setTimeout(location.reload, 3000); + let res = await backHomeAction(); + WHNotify(res); + if (!res.includes('error')) { + WHNotify('成功,即将刷新'); + setTimeout(() => location.reload(), 3000); + } else { + WHNotify('出错了'); + } } $zhongNode.initTimer.innerHTML = `助手加载时间 ${Date.now() - start_timestamp}ms`;