From 1ac6b88e754c297d092d59aada76ef87397d4050 Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 28 Feb 2025 17:08:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor(api):=20=E4=BC=98=E5=8C=96=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF=E6=B7=BB=E5=8A=A0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改了 expiryTime 的判断条件,使用不等于 0 替代大于 0,以处理所有非零值 - 优化了代码结构,提高了可读性 --- api/client/add.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/client/add.js b/api/client/add.js index a5d8b8b..31974a8 100644 --- a/api/client/add.js +++ b/api/client/add.js @@ -17,7 +17,7 @@ module.exports = async (ctx) => { if (!inbound?.success) return (ctx.body = { code: "1", msg: "获取节点失败" }); const uuid = randomUUID(); email = email || uuid.split("-")[0]; - if (expiryTime > 0) { + if (expiryTime!=0) { expiryTime = dayjs(expiryTime, "YYYY-MM-DD HH:mm:ss").valueOf(); } totalGB = totalGB * 1024 * 1024 * 1024;