From 21d36675dc72835a7e8764f3e963c070d4fffe56 Mon Sep 17 00:00:00 2001 From: any Date: Wed, 16 Dec 2020 16:41:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_watch.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jd_watch.js b/jd_watch.js index 4830e97b..fb297b18 100644 --- a/jd_watch.js +++ b/jd_watch.js @@ -67,9 +67,16 @@ if ($.isNode()) { const JD_API_HOST = 'https://api.m.jd.com/client.action'; !(async () => { if($.isNode()){ - const stats = await util.promisify(fs.stat)('watch.chlsj'); - if(stats.isFile()){ - preload() + const fs = require('fs'); + try { + if (fs.existsSync('watch.chlsj')) { + preload() + if (doBody.length < 40){ + console.log(`${$.name}Body数小于40,无法完成任务!`) + } + } + } catch(err) { + console.error(err) } } if (!cookiesArr[0]) {