From 1ead079af46e5f84b0c1515438df3f65121d94ff Mon Sep 17 00:00:00 2001 From: ljx0305 Date: Thu, 10 Jul 2025 14:15:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=88=A4=E6=96=ADJson::Value?= =?UTF-8?q?::find=E5=87=BD=E6=95=B0=E8=BF=94=E5=9B=9E=E5=80=BC=20(#4347)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正Json::Value::find函数返回值并非iterator而是Value指针 --- server/WebApi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/WebApi.h b/server/WebApi.h index 79fea18f..9830dfd4 100755 --- a/server/WebApi.h +++ b/server/WebApi.h @@ -89,11 +89,11 @@ std::string getValue(Args &args, const Key &key) { template std::string getValue(Json::Value &args, const Key &key) { - auto it = args.find(key); - if (it == args.end()) { + auto value = args.find(key); + if (value == nullptr) { return ""; } - return it->second.asString(); + return value->asString(); } template