每日Bug汇总--Day05

Bug汇总—Day05

一、项目运行报错

二、项目运行Bug

1、**问题描述:**前端将从后台查询的数据作为参数进行get请求,参数为空
image-20240412112802690

原因分析:

  • 这种写法可能只支全局的参数
  • 调用方法的传参响应

代码实现

if (this.jishiName) {
      this.$http({
        url: `huiyuanyuyuexinxi/xiaofei/${this.jishiName}`,
        method: 'get'
      }).then(res => {
        console.log(res.data)
        // 读取接口请求成功回传回来的数据
        var Huiyuanxiaofeixinxis = res.data.Huiyuanxiaofeixinxis
        // 定义数组,存放一会覆盖echarts图形的数据
        var data = []
        console.log(Huiyuanxiaofeixinxis.length)
        // 循环遍历数组,取出数据,转成和data一样的格式
        for (var i = 0; i < Huiyuanxiaofeixinxis.length; i++) {
          var d = { name: '', value: 0 }
          d.name = Huiyuanxiaofeixinxis[i].xingming
          d.value = Huiyuanxiaofeixinxis[i].nianxiaofeie
          // 往data数组中添加数据
          data.push(d)
        }
        // 排序,b - a降序——a - b升序
        data.sort((a, b) => b.value - a.value)
        // 覆盖data(){}中全局变量的数据
        this.dataHuiyuanXiaoliang = data
        // 画出图形
        this.DrawNian()
      }).catch(err => {
        console.log(err)
        console.log("后台接口请求失败!")
      })
    } else {
      this.$http({
        url: `jishi/jishiName/${this.$storage.get('adminName')}`,
        method: 'get'
      }).then(res => {
        console.log(res.data.data)
        this.jishiName = res.data.data
        this.$http({
          url: `huiyuanyuyuexinxi/xiaofei/${this.jishiName}`,
          method: 'get'
        }).then(res => {
          console.log(res.data)
          // 读取接口请求成功回传回来的数据
          var Huiyuanxiaofeixinxis = res.data.Huiyuanxiaofeixinxis
          // 定义数组,存放一会覆盖echarts图形的数据
          var data = []
          console.log(Huiyuanxiaofeixinxis.length)
          // 循环遍历数组,取出数据,转成和data一样的格式
          for (var i = 0; i < Huiyuanxiaofeixinxis.length; i++) {
            var d = { name: '', value: 0 }
            d.name = Huiyuanxiaofeixinxis[i].xiangmumingcheng
            d.value = Huiyuanxiaofeixinxis[i].count
            // 往data数组中添加数据
            data.push(d)
          }
          // 排序,b - a降序——a - b升序
          data.sort((a, b) => b.value - a.value)
          // 覆盖data(){}中全局变量的数据
          this.dataHuiyuanXiaoliang = data
          // 画出图形
          this.DrawNian()
        }).catch(err => {
          console.log(err)
          console.log("后台接口请求失败!")
        })
        console.log("技师姓名查询成功!")
      })
    }

2、问题描述: Parameter ‘jishiNames’ not found. Available parameters are [collection, list]

解决思路: 在DAO层方法参数加注解@Param(“jishiNames”)

实现代码:

List<JishinianyejitongjiEntity> selectJiShixiaofeixinxis(@Param("jishiNames") List<String> jishiNames);
  • 11
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

卷Java

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值