From d06f8ef885cdd484de0d7bafd44ff53a576aa243 Mon Sep 17 00:00:00 2001 From: yeyang <746659424@qq.com> Date: Thu, 27 Oct 2022 15:38:50 +0800 Subject: [PATCH] modified: apps/fun.js --- apps/fun.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/fun.js b/apps/fun.js index 974a050..bfd17d5 100644 --- a/apps/fun.js +++ b/apps/fun.js @@ -273,6 +273,7 @@ export class example extends plugin { let api = 'https://xiaobai.klizi.cn/API/other/bcy_topic.php' let res = await fetch(api).then(res => res.json()).catch(err => console.log(err)) if (!res) return e.reply("接口失效") + if (res.code != 200) return e.reply(`请求错误!,错误码:${res.code}`) let msg = []; for (let i of res.data) { msg.push(i.title);