fix(server): 修复物品发送结果判断逻辑

- 将判断条件从 result.data.result 修改为 result.data == "成功"
- 优化了发送结果的判断逻辑,确保正确处理发送成功和失败的情况
This commit is contained in:
2025-04-24 20:08:47 +08:00
parent 7cc37b0523
commit 34cebffd0c

View File

@@ -44,7 +44,7 @@ router.post("/item/send", async (req, res) => {
}
);
console.log("物品[%s]发送给[%s]结果:%s", itemId, roleName, result.data);
if (result.data.result) res.json({ code: 0, msg: "发送成功!" });
if (result.data == "成功") res.json({ code: 0, msg: "发送成功!" });
else res.json({ code: 1, msg: result.data.content });
} catch (error) {
console.error("获取角色数据失败:", error);