fix(client): 优化用户添加功能

- 修复到期时间判断逻辑,提高代码可读性
- 完善错误信息提示,方便排查问题
This commit is contained in:
2025-03-07 18:29:36 +08:00
parent 5142e6f245
commit b03396a467

View File

@@ -16,7 +16,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;
@@ -37,7 +37,7 @@ module.exports = async (ctx) => {
} else {
ctx.body = {
code: 1,
message: "添加失败",
message: "添加失败:" + result?.msg || "未知原因",
data: ctx.request.body,
};
}