软件开发和网站开发难度,wordpress 编写页面,hexo插件wordpress,编程是学什么东西的Bug汇总—Day05
一、项目运行报错
二、项目运行Bug
1、**问题描述#xff1a;**前端将从后台查询的数据作为参数进行get请求#xff0c;参数为空
原因分析#xff1a;
这种写法可能只支全局的参数调用方法的传参响应
代码实现
if (this.jishiName) {this.$http({url…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 Huiyuanxiaofeixinxis.length; i) {var d { name: , value: 0 }d.name Huiyuanxiaofeixinxis[i].xingmingd.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.datathis.$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].xiangmumingchengd.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”)
实现代码
ListJishinianyejitongjiEntity selectJiShixiaofeixinxis(Param(jishiNames) ListString jishiNames);