每日Bug汇总--Day05

Bug汇总---Day05

一、项目运行报错

二、项目运行Bug

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

原因分析:

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

代码实现

js 复制代码
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")

实现代码:

java 复制代码
List<JishinianyejitongjiEntity> selectJiShixiaofeixinxis(@Param("jishiNames") List<String> jishiNames);
相关推荐
码上淘金6 分钟前
【Python】Python常用控制结构详解:条件判断、遍历与循环控制
开发语言·python
Brilliant Nemo9 分钟前
四、SpringMVC实战:构建高效表述层框架
开发语言·python
a濯2 小时前
element plus el-table多选框跨页多选保留
javascript·vue.js
格林威2 小时前
Baumer工业相机堡盟工业相机的工业视觉中为什么偏爱“黑白相机”
开发语言·c++·人工智能·数码相机·计算机视觉
小林学习编程2 小时前
SpringBoot校园失物招领信息平台
java·spring boot·后端
撸码到无法自拔2 小时前
docker常见命令
java·spring cloud·docker·容器·eureka
橙子199110162 小时前
在 Kotlin 中什么是委托属性,简要说说其使用场景和原理
android·开发语言·kotlin
androidwork2 小时前
Kotlin Android LeakCanary内存泄漏检测实战
android·开发语言·kotlin
heart000_12 小时前
IDEA 插件推荐:提升编程效率
java·ide·intellij-idea
学地理的小胖砸3 小时前
【Python 基础语法】
开发语言·python