Bladeren bron

#兼容老分布式

zxs 1 week geleden
bovenliggende
commit
d78f817638
1 gewijzigde bestanden met toevoegingen van 3 en 0 verwijderingen
  1. 3 0
      robot/robotics/v2/nexus_net_client.hpp

+ 3 - 0
robot/robotics/v2/nexus_net_client.hpp

@@ -895,6 +895,7 @@ namespace robotics::v2 {
             //路由列表
             routes = value.routes;
             std::string json = std::string(value.args[0].data.begin(), value.args[0].data.end());
+            json = robotics::v3::utils::gbk_to_utf8(json);
             //app信息
             robotics::v3::json_convert::deserialize(json, app_info);
         }
@@ -1199,6 +1200,7 @@ namespace robotics::v2 {
         enum { value_type = nexus_net_param_type_enum::Struct };
         static void serialize(_Type& value, nexus_net_parameter_info& result) {
             std::string json = robotics::v3::json_convert::serialize(value);
+            json = robotics::v3::utils::utf8_to_gbk(json);
             result.type = value_type;
             result.size = json.size();
             result.data.assign(json.begin(), json.end());
@@ -1207,6 +1209,7 @@ namespace robotics::v2 {
             if (value.type != value_type || value.data.empty())
                 throw std::runtime_error("参数错误1126");
             std::string json(value.data.begin(), value.data.end());
+            json = robotics::v3::utils::gbk_to_utf8(json);
             robotics::v3::json_convert::deserialize(json, result);
         }
     };