Bug汇总—Day05
一、项目运行报错
二、项目运行Bug
1、**问题描述:**前端将从后台查询的数据作为参数进行get请求,参数为空
原因分析:
- 这种写法可能只支全局的参数
- 调用方法的传参响应
代码实现
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 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 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 selectJiShixiaofeixinxis(@Param("jishiNames") List jishiNames);