public object GetMessCountByUserId([FromBody] JObject json) { try { string res = json.Value <string>("json"); dynamic dy = JsonConvert.DeserializeObject <ExpandoObject>(res); string userId = dy.userid; OperatorProvider.AppUserId = userId; //设置当前用户 Operator user = OperatorProvider.Provider.Current(); var num = messagebll.GetMessCountByUserId(user); return(new { code = 0, count = 1, info = "获取数据成功", data = num }); } catch (Exception ex) { return(new { code = -1, count = 0, info = ex.Message }); } }