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 ...
随机推荐
- Git--生成公钥和私钥并添加gitlab访问权限
Git配置 打开git bash 执行以下命令 git config --global user.name 用户名 git config --global user.email 邮箱 ssh-keyg ...
- ysoserial CommonsColletions7分析
CC7也是一条比较通用的链了,不过对于其原理的话,其实还是挺复杂的.文章如有错误,敬请大佬们斧正 CC7利用的是hashtable#readObject作为反序列化入口.AbstractMap的equ ...
- linux 下的shutdown指令
命令简介: 该命令可以安全关闭或者重新启动系统.你没有看错,shutdown命令不仅可以关闭系统.也可以重启Linux系统. 命令语法: /sbin/shutdown [-t sec] [-arkhn ...
- 使用Eclipse的基本配置
因本人 IntelliJ IDEA 正版授权前些日子已到期,最近开始使用 Eclipse .体验开发了一阵子,觉得除了在界面美观与前端编辑的操作上 Eclipse 与 IDEA 差距还比较大以外,其他 ...
- 自己实现Controller——标准型
标准Controller 上一篇通过一个简单的例子,编写了一个controller-manager,以及一个极简单的controller.从而对controller的开发有个最基本的认识,但是细心观察 ...
- 关于pycharm创建django1.x和3.x项目的说明
1.我创建了两个模板文件分别代表django1.x和3.x 2.两个模板文件分别为Django1Template和Django3Template (不同模板文件中存放不同的django版本) 3.使用 ...
- PHP中的那些魔术常量
之前我们已经了解了一些常用的魔术方法,除了魔术方法外,PHP还提供一些魔术常量,相信大家在日常的工作中也都使用过,这里给大家做一个总结. 其实PHP还提供了很多常量但都依赖于各类扩展库,而有几个常量是 ...
- css3 animate转圈360旋转
.logo{ width:20px; height: 20px; background: red; -webkit-animation:haha1 .8s linear infinite; anima ...
- TP生成二维码插件
安装 composer require endroid/qrcode 使用: use Endroid\QrCode\QrCode 然后 这个类库要改一下 在路径:你的项目路径\vendor\endro ...
- css 参考手册 部署到本地
* 到css参考手册网站 http://css.doyoe.com/ 下载chm手册 * 到github下载对应的html页面 cd /Applications/XAMPP/htdocs git cl ...