diff --git a/api/client/add.js b/api/client/add.js index 3cc9ca0..a5d8b8b 100644 --- a/api/client/add.js +++ b/api/client/add.js @@ -5,7 +5,7 @@ const getCookie = require("../../auth/3xuiLogin"); const { log } = require("console"); module.exports = async (ctx) => { - let { id = 4, limitIp, expiryTime = 0, enable = !0, totalGB = 1, subId = "2rv0gb458kbfl532" } = ctx.request.body; + let { id = 4, limitIp, expiryTime = 0, enable = !0, totalGB = 1, subId = "2rv0gb458kbfl532", email } = ctx.request.body; if (!ctx.state.cookie) { ctx.state.cookie = await getCookie(); ins.interceptors.request.use((config) => { @@ -15,8 +15,8 @@ module.exports = async (ctx) => { } const inbound = await ins.get(`/panel/api/inbounds/get/${id}`); if (!inbound?.success) return (ctx.body = { code: "1", msg: "获取节点失败" }); - const uuid = randomUUID(), - email = uuid.split("-")[0]; + const uuid = randomUUID(); + email = email || uuid.split("-")[0]; if (expiryTime > 0) { expiryTime = dayjs(expiryTime, "YYYY-MM-DD HH:mm:ss").valueOf(); }