10.12工作问题及解决

1.get请求

 axios.get('http://carapply.ywscjt.com.cn/m', { params: { api: "apply.getApplyPageApiService",  v: "1.0", } }).then(function (resp) {
    if(resp.data.data.list.id = _this.input1){
      console.log(resp.data.data.list[_this.input1-1])
      _this.tableData.id = resp.data.data.list[_this.input1-1].id
      _this.tableData.dname = resp.data.data.list[_this.input1-1].name
      // _this.tableData.dsfz = resp.data.certNo
      // _this.tableData.dphone = resp.data.phone
      // _this.tableData.dvaccine = resp.data.isVaccination
      // _this.tableData.ddanger = resp.data.isRisk
      // _this.tableData.region = resp.data.province + resp.data.city + resp.data.area
      // _this.tableData.carnumber = resp.data.carNumber
      // _this.tableData.placenumber = resp.data.boothNo
      // _this.tableData.itemname = resp.data.goodsName
      // _this.tableData.itemweight = resp.data.weight
      // _this.tableData.import = resp.data.isImportGoods
    }else{
      _this.$alert('未查询到此人员!', '消息', {
        confirmButtonText: '确定',
      })
    }
  })
}

2.Uncaught (in promise) TypeError: Cannot set properties of undefined

出现这种情况把 function (resp) 改为箭头函数 (resp)=>

3.带参数的post请求

使用axios调用post请求传参的两种方式_BUG_Jia的博客-CSDN博客_axios post请求传参数
vue中使用axios插件做post请求带参数_allen_csdns的博客-CSDN博客 
Vue axios post请求带参请求 详细教程_南七铭的博客-CSDN博客a​​​​​​​
axios.post发送请求,axios发送post请求, 携带参数传递给接口_yunchong_zhao的博客-CSDN博客_axios发送post请求带参数Vue axios post请求带参请求 详细教程_南七铭的博客-CSDN博客a​​​​​​​

4.打开开发者工具调不了接口

换Chrome hhh

5.一些奇怪的地方

这里console.log显示的数据不对 但是在网络的载荷里显示的数据又是传过去的 有点不明白捏

好像是参数没和后端对接好 不明白唔

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值