在请求菜单页面时,会弹出一个请求不到菜单接口,当时的代码是

@RequestMapping(value = "get/tree",method = {RequestMethod.GET,RequestMethod.POST})@ApiOperation(tags = "菜单管理左侧菜单树链接",value = "获取菜单树")public DtreeResult getTree(){DtreeResult result = new DtreeResult();
//      同dtree中status一样设置
//  -------------此处出错-------------------------------------HashMap<Object, Object> map = new HashMap<>();map.put("code",200);map.put("message","操作成功");result.setStatus(map);
//      同dtree中data一样设置List<TreeNode> nodeList=menuService.getTreeNode();result.setData(nodeList);return result;}

之后看了一下代码,发现map返回的是一个map集合,并且里面的参数有误,应该改成:

Map<String,Object> map=new HashMap<>();

完整代码:

@RequestMapping(value = "get/tree",method = {RequestMethod.GET,RequestMethod.POST})@ApiOperation(tags = "菜单管理左侧菜单树链接",value = "获取菜单树")public DtreeResult getTree(){DtreeResult result = new DtreeResult();
//      同dtree中status一样设置Map<String,Object> map=new HashMap<>();map.put("code",200);map.put("message","操作成功");result.setStatus(map);
//      同dtree中data一样设置List<TreeNode> nodeList=menuService.getTreeNode();result.setData(nodeList);return result;}

解决Cannot read properties of null (reading ‘code‘)相关推荐

  1. TypeError: Cannot read properties of null (reading ‘indexOf‘)

    问题描述: TypeError: Cannot read properties of null (reading 'indexOf') 意思是:TypeError:无法读取null的属性(读取'ind ...

  2. [Vue warn]: Error in mount hook: “TypeError: Cannot read properties of null (reading ‘getAttribute‘)

    在vue项目中,使用echarts报一下的错误: [Vue warn]: Error in mount hook: "TypeError: Cannot read properties of ...

  3. 15 flvjs 播放 ws 服务代理的不存在的 rtsp 连接, Cannot read properties of null (reading ‘flushStashedSamples‘)

    前言 这是基于 flvjs 播放 rtsp视频服务 基于node+ffmpeg 转换为 flv 视频服务 的时候, 衍生出来的一个问题 在生产环境上面, 很大一部分 rtsp 服务是正常的可以播放的, ...

  4. 高德地图点聚合插件AMap.MarkerClusterer报错Uncaught TypeError: Cannot read properties of null (reading ‘Md‘)

    报错信息:Uncaught TypeError: Cannot read properties of null (reading 'Md') mapscallback=___onAPILoaded&a ...

  5. TypeError: Cannot read properties of null (reading ‘insertBefore‘)

    TypeError: Cannot read properties of null (reading 'insertBefore') vite build vue3之后线上报错! 项目版本 vue3 ...

  6. 引入echarts的js文件报错——Cannot read properties of null (reading ‘getAttribute‘)

    今天在引入echarts.min.js的时候总是报错: 报错如下: 该问题为:无法读取空的属性"获取属性" 根据分析,错误原因有两个: 1.初始化echarts对象不存在 2.js ...

  7. npm 报错 ERR Cannot read properties of null reading ‘package npm ERR A complete log of this run can

    通过npm install 安装依赖报如下错误. 解决办法:尝试通过cnpm install 或yarn install 即可解决.

  8. 解决Cannot read properties of undefined (reading ‘name ‘)“found in,初次加载报错(user.classmate.name)

    <div>{{user.classmate.name}}</div> const { user } = await getUser(this.queryParams) this ...

  9. vue TypeError: Cannot read properties of null (reading 'insertBefore')

    这个错误通常是由于在组件中使用了 insertBefore 方法时,试图插入到一个不存在的父节点导致的.您可以使用 v-if 指令或在 JavaScript 代码中进行 null 值检查来避免这种情况 ...

最新文章

  1. mysql当前时间减1小时_最佳睡眠时间:晚上睡眠不超8小时,午睡不超1小时
  2. Unbalanced calls to begin/end appearance transitions for XXXX
  3. mysql 四 表操作
  4. 365篇原创后,有三AI喊你正式加入来不来?
  5. 云炬WEB开发笔记2-7 代理神器CharlesFiddler
  6. 2016年第一堂课课后作业1
  7. 重言式判别c语言中文网,重言式判别 重言式判别源码及课程设计 c语言版.doc
  8. 4大JVM性能分析工具详解,及内存泄漏分析方案
  9. Linux中的redis集群搭建
  10. UnhandledPromiseRejectionWarning报错send()的处理
  11. python经典书籍推荐:Python面向对象编程指南 : Mastering Object-oriented
  12. 卡住 安装_【书中有路】弹簧式安全阀结构原理、故障解析、安装要点
  13. linux bash基本特性
  14. 什么是Android上的“上下文”?
  15. 【图文】远程桌面链接:这可能是由于credssp加密oracle修正
  16. 删除root 家目录,及恢复方法
  17. webstorm 自定义项目模板
  18. Mac终端神器iTerm2配置(oh-my-zsh+shell integration+Powerlevel9k)
  19. jetson nano开电源_NVIDIA Jetson Nano开发者套件入门指南
  20. 阿里云服务器访问windows下网页(内网穿透)

热门文章

  1. 【luogu P3393 逃离僵尸岛】 题解
  2. 以太坊联合创始人Gavin Wood在Neutrino北京布道区块链3.0
  3. 移除开机没插sim卡提示
  4. linux 建组,linux 创建组,创建用户
  5. 图片质量估计-如何判定一个人脸是否为阴阳脸(第一弹:python版本)
  6. winform实现图片像素化的关键
  7. jmeter之插件perfmon
  8. 分享 朋友圈 微博 QQ空间
  9. 【微信小程序PDF云大师】
  10. 2021年中国珠宝行业发展现状及A股上市企业分析[图]