refactor(api): 优化客户端添加逻辑
- 修改了 expiryTime 的判断条件,使用不等于 0 替代大于 0,以处理所有非零值 - 优化了代码结构,提高了可读性
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user