netcore 3.1 This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32.

安装  Microsoft.AspNetCore.Mvc.Newtonsoft  包

在startup.cs中添加

public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
            services.AddMvcCore().AddNewtonsoftJson(options => {
                options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
            });
            RegisterMyServices(services);
        }
原文地址:https://www.cnblogs.com/huanyun/p/12287403.html