更新时间:2023-01-06 08:01:16
您可以通过将根数据传递给调用来做到这一点
You can do like this by passing in the root data to the invoke
connection.invoke('Send', "rk", "wassup", Root);
然后在中心中为根数据添加另一个参数
Then in your hub add another params for the root data
public async Task Send (string user , string message, string root)
{
await Clients.All.SendAsync("Send", user, message);
}
由于您提交了json字符串,因此可以更新
Update since you are submit json string you can use
JsonConvert.DeserializeObject<List<object>>(root);