每日Bug汇总--Day04

Bug汇总—Day04

一、项目运行报错

二、项目运行Bug

1、**问题描述:**下拉框关联数据,选择下拉框数据后,联动输入框中的数据查询不到,在后台接收到的是null

原因分析:

  • 前端是否正确接收到了参数’jishigonghao’(判断不是)
    selectJiShiNameBygonghao(jishigonghao) {
      this.$http({
        url: 'jishi/getJiShiGongName',
        method: 'get',
        params: jishigonghao
      }).then(res => {
        console.log("传递的参数")
        console.log(jishigonghao)
        console.log("查询技师姓名")
        console.log(res)
        console.log(res.data)
        this.ruleForm.jishixingming = res.data
      })

image-20240411153353468

  • 传递参数的时候后端API不能直接写string name这样,得用路径url传递参数

实现代码:

  • 前端
    selectJiShiNameBygonghao(jishigonghao) {
      this.$http({
        url: `jishi/getJiShiGongName/${jishigonghao}`,
        method: 'get',
      }).then(res => {
        console.log("传递的参数")
        console.log(jishigonghao)
        console.log("查询技师姓名")
        console.log(res)
        console.log(res.data)
        this.ruleForm.jishixingming = res.data
      })
    },
  • 后端
	/**
	 * 后端查询根据技师工号查询技师姓名
	 */
	@RequestMapping("/getJiShiGongName/{jishigonghao}")
	public R getJiShiGongName(@PathVariable("jishigonghao") String jishigonghao) {
		System.out.println("技师工号为:" + jishigonghao);
		List<String> result = jishiService.getJiShiGongName(jishigonghao);
		return R.ok().put("data", result);
	}

2、按照上述修改完成以后还是出了问题

image-20240411154104373

原因分析:

后端接收的参数层级不对

console.log(res.data.data)
this.ruleForm.jishixingming = res.data.data

image-20240411154332676

3、问题描述:

2024-04-11 15:49:31.385  WARN 3648 --- [nio-8080-exec-8] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token
 at [Source: (PushbackInputStream); line: 1, column: 287] (through reference chain: com.entity.MeirongxiangmuEntity["jishixingming"])]

原因分析:

  • 传递的参数中的技师姓名是个数组不是字符串

实现代码

 console.log(res.data.data[0])
this.ruleForm.jishixingming = res.data.data[0]

4、添加了一条重复项目名称的数据后,数据库所有的数据都变成了这条数据

image-20240411155656765

分析原因:

  • SQL语句写的有问题
 select count(*)
        from meirongxiangmu
        where xiangmumingcheng= #{xiangmumingcheng}
```rom meirongxiangmu
        where xiangmumingcheng= #{xiangmumingcheng}
  • 后台查询的Wrapper没有写条件

相关推荐

  1. PX4 Bug汇总

    2024-04-12 08:44:04       37 阅读
  2. python遇到bug问题汇总

    2024-04-12 08:44:04       37 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-12 08:44:04       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-12 08:44:04       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-12 08:44:04       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-12 08:44:04       20 阅读

热门阅读

  1. 【gitlab】修改默认存放存放目录

    2024-04-12 08:44:04       50 阅读
  2. 数据湖/数据仓库

    2024-04-12 08:44:04       16 阅读
  3. MVC和MVVM这两种设计模式的区别

    2024-04-12 08:44:04       22 阅读
  4. [大模型]Atom-7B-chat 全量微调

    2024-04-12 08:44:04       18 阅读
  5. [C++11] nullptr完整解析

    2024-04-12 08:44:04       19 阅读
  6. 数据结构-单调队列

    2024-04-12 08:44:04       19 阅读
  7. 华为eNSP网络模拟器 eNSP设备基础配置

    2024-04-12 08:44:04       38 阅读
  8. 模型4-掌握基于模型替换的角色换装技术

    2024-04-12 08:44:04       19 阅读
  9. mediasoup多线程(构思)

    2024-04-12 08:44:04       19 阅读