{
"result": {
"cover": {
"title": "标题",
"img": "https://localhost:5001/UpLoadFiels/pic.png",
"link": "",
"url": "ts_nr"
},
"list": [
{
"title": "标题1",
"img": "https://localhost:5001/UpLoadFiels/pic.png",
"link": "",
"url": "ts_nr"
},
{
"title": "标题2",
"img": "https://localhost:5001/UpLoadFiels/pic.png",
"link": "",
"url": "ts_nr"
}
]
},
"ts": {
"rs": "600",
"tpe": "定时推送",
"jhsj": "2026-03-04 00:00:00",
"title": "1",
"bz": "1"
}
} [NonUnify]
[Route("Add")]
[HttpPost]
public async Task<object> Add([FromBody] dynamic json)
{
var ts = json.ts;
var rs = ts.rs;
var result = json.result;
var cover= result.cover;
var title = cover.title;
//数组
var list = json.result.list;
var listcount = list.Count;
var lstr = "";
foreach (var item in list)
{
string title1 = item.title;
string img1 = item.img;
lstr+= "标题:" + title1 + ",图片:" + img1 + "\n";
}
return lstr;
}
#endregion
} fetch('/api/tsExt/Add', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(finalData)
})
.then(res => res.json())
.then(res => {
console.log(res);
});