From 86bc77cda336f28254178dbfb7440e39b0949114 Mon Sep 17 00:00:00 2001
From: chenzx <m15572880737@163.com>
Date: 星期三, 03 四月 2024 19:31:09 +0800
Subject: [PATCH] 20240403czx修改json
---
GasolineBlend/Controllers/WenCaiController.cs | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/GasolineBlend/Controllers/WenCaiController.cs b/GasolineBlend/Controllers/WenCaiController.cs
index 04d061e..a5ac397 100644
--- a/GasolineBlend/Controllers/WenCaiController.cs
+++ b/GasolineBlend/Controllers/WenCaiController.cs
@@ -3,6 +3,7 @@
using System.Web.Mvc;
using CommonHelper;
using CommonHelper.Redis;
+using Newtonsoft.Json.Linq;
using Flurl.Http;
namespace GasolineBlend.Controllers
@@ -20,6 +21,7 @@
{
var v = _customerRedis.Get("wencai_v"); //"A1KZZpxeY5TyBp9oALdJcIVAoxItY1b9iGdKIRyrfoXwL_CIBPOmDVj3mjDv";//
var url = "https://www.iwencai.com/unifiedwap/unified-wap/v2/result/get-robot-data";
+
var param = new
{
question=question,
@@ -28,11 +30,10 @@
source= "Ths_iwencai_Xuangu",
add_info="{\"urp\":{\"scene\":3,\"company\":1,\"business\":1,\"is_lowcode\":1},\"contentType\":\"json\"}"
};
-
var res = await url.WithHeader("hexin-v", v).PostUrlEncodedAsync(param).ReceiveString();
string strCov = Regex.Unescape(res);
//鍘婚櫎鍐椾綑瀛楁
- string tmpInfoA="", strCovA="";
+ string tmpInfoA ="", strCovA="";
int i = strCov.IndexOf("\"meta\"");
int j = strCov.IndexOf("\"puuid\"");
if (i > 0 && j > 0)
@@ -41,7 +42,14 @@
strCovA = strCov.Replace(tmpInfoA, "");
}
i = strCovA.IndexOf("\"layout_data\"");
- j = strCovA.IndexOf("\"layout_mode\"");
+ j = strCovA.IndexOf("\"layout_mode\"");
+ if (i > 0 && j > 0)
+ {
+ tmpInfoA = strCovA.Substring(i, j - i);
+ strCovA = strCovA.Replace(tmpInfoA, "");
+ }
+ i = strCovA.IndexOf("\"appModule\"");
+ j = strCovA.IndexOf("\"appVersion\"");
if (i > 0 && j > 0)
{
tmpInfoA = strCovA.Substring(i, j - i);
--
Gitblit v1.8.0