Request failed with status code 500以及自引用循环Self referencing loop detected for property ‘xx‘ with type
错误Error: Request failed with status code 500 ,调试前端没问题,后端也没问题,还报错“连接超时” 在Network中找到错误Self referencing loop detected for property 'xxxx' with type
当我们后端调试一步一步调试也没发现错误在哪里,但是跳转到前端就报错了。前端没有接收到后端传过来的数据,总结了一下:
**前端接收问题**
前端就是接收**字段名**以及**类型**问题 比如:nAmE,names,name:0,name:[]等等名字和类型问题
data() {
return {
filter: {
name: null,
}}},
this.axios.get("/api/xxx/xxx").then((res) => {
可以加一个弹窗看看有没有跳进来,跳进来了就是前端问题
alert();
this.name=res;
});
**后端问题**
当我们在数据库里面添加对应表的**外键** 并调用 *程序中经常会用到来回调用,或者调用当前的下一级等等场景*
public class User
{
public int id { get; set; }
public int LoginId { get; set; }
public Login Logins{ get; set; }
} public class User
{
public int id { get; set; }
public int UserId { get; set;}
public User Users{ get; set; }
}
在后端处理完后,往前端返回数据的时候
public xxx
{
var result= user.quer();
return ok(result)
}
这个时候注意一个问题不然就会上述错误
//当我们引用 user的时候
//类里面
user ——> id=1
LoginId=1
Login =system.Login //这是一般的时候不会有错误,因为LoginId没有对应的user表
就怕这个时候你引用类里面又反过来调用我们的类,形成的逻辑循环
user ——> id=1
LoginId=1
Login =system.Login ——>id=1
UserId=1
User=system.User ——> id=1
Login=1
Login=system.Login ——> id=1
UserId=1
User=system.User ——>.........
//.................以此类推一直循环,但这本身没有错误不会报错..........................
总结:当我们的 user类外键链接了Login类,而Login类也链接了User类,这个时候输出User类的时候恰好有个LoginId值,使得Login也调用了User,那就会形成自引用循环,就会报错
希望上述能帮到你
Request failed with status code 500以及自引用循环Self referencing loop detected for property ‘xx‘ with type的更多相关文章
- Uncaught (in promise) Error: Request failed with status code 500解决方案
今天又学到一种修改bug的方法 : let newpwd = crypto.createHash('md5').update(req.body.upwd).digest('hex'); 在点击按钮加 ...
- axios请求报Uncaught (in promise) Error: Request failed with status code 404
使用axios处理请求时,出现的问题解决 当url是远程接口链接时,会报404的错误: Uncaught (in promise) Error: Request failed with status ...
- Android通过soap2访问webservice遇到HTTP request failed, HTTP status: 302的问题
笔者用C#在服务器端写了一个Webservice,然后再Android客户端通过soap2调用webservice的函数,遇到了HTTP request failed, HTTP status: 30 ...
- 源映射错误:request failed with status 404
源映射错误:request failed with status 404:源映射错误:request failed with status 404
- Qt error ------ 出现Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly
出现原因: 使用了不存在的对象 数组越界了 用 delete 释放未分配的内存空间,或者超过一次释放同个内存 比如: 顺序不能颠倒 正确: ui->setupUi(this); ui->t ...
- RtlWerpReportException failed with status code :-1073741823
在release下程序运行总是崩溃:debugView输出了这个崩溃信息, 1. 一开始是release看崩溃,各种二分法找崩溃点,太玄没找到: 2. 终于想到可以调试,我草,调试一下瞬间发现某个cl ...
- 浏览器提示:源映射错误:request failed with status 404 源 URL:http://xxx.js 源映射 URL:jquery.min.map
浏览器 jquery1.9.1min.js 报脚本错误 无jquery.min.map 文件 最近在浏览个人网站的时候就遇到了这个问题 我先说一下什么是source map文件. source map ...
- 重定向Http status code 303 和 302
http 302 http 303 Http 302 302是一个普通的重定向代码.直观的看来是,请求者(浏览器或者模拟http请求)发起一个请求,然后服务端重定向到另一个地址.而事实上,服务端仅仅是 ...
- Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html"
2015-11-16 10:39:17.235 PullDemo[338:60b] Application windows are expected to have a root view contr ...
随机推荐
- JUnit5 快速入门指南
1. 安装 在pom中添加依赖 <properties> <junit.jupiter.version>5.3.2</junit.jupiter.version> ...
- docker-compose up -d nginx 报错
在阿里云ECS上创建nginx容器时,报错如上图. The solution: In your Dockerfile, before running any apt commands, add the ...
- AspectJ——AOP框架快速入门
一.导包 二.bean.xml配置 三.环绕通知 四,表达式
- 利用k8s yaml配置文件起一个http能够让外部访问
1.首先建一个http的Deployment apiVersion: apps/v1 #版本信息 kind: Deployment #文件类型 metadata: #Deployment资源的元数据信 ...
- Android仿QQ空间发表动态
效果展示图: 功能描述:用户点击+会进入发表动态的界面,发表成功后跳转到个人首页. 后续完善:增加个人头像的上传,对界面进行优化,增加点赞和评论的功能. 主要采用listview对内容进行展示,对sq ...
- 【PHP数据结构】栈和队列的应用
通过栈和队列的学习,我们似乎会感觉到其实数据结构还是非常简单的嘛.当然,这只是一个开始,我们从顺序表.链表开始,到现在的栈和队列,其实都是为了将来在铺路.在树和图的遍历算法中,都可以见到栈和队列的身影 ...
- nuxt打包等注意事项
打包步骤: 1.首先执行 npm run build 2.将打包好的 .nuxt static nuxt.config.js package.json 这四个文件丢到服务器的某个文件夹中,在服务器上安 ...
- 【Azure 应用服务】App Service For Linux 部署PHP Laravel 项目,如何修改首页路径为 wwwroot\public\index.php
问题描述 参考官方文档部署 PHP Laravel 项目到App Service for Linux环境中,但是访问应用时候遇见了500 Server Error 错误. 从部署的日志中,可以明确看出 ...
- Java面向对象系列(1)- 什么是面向对象
面向过程 & 面向对象 面向过程思想 步骤清晰清楚,第一步做什么,第二步做什么-- 面对过程适合处理一些较为简单的问题 面向对象思想 物以类聚,分类的思维模式,思考问题首先会解决问题需要哪些分 ...
- python读取文件编码转换问题
encode(编码) decode(解码) encoding(编码格式) #-*- coding:utf-8 -*- import chardet #用于查看编码 with open(&quo ...